Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

dates in excel

0 views
Skip to first unread message

David

unread,
Jun 2, 2005, 12:27:42 AM6/2/05
to
I have a need to automatically save the current date to a cell in an excel spreadsheet every time the sheet is saved.
 
Today() always returns the current date, so once I open the sheet on a new day I can no longer see the date the information was last updated, i.e. saved.
 
Any help would be appreciated.

Nick Hodge

unread,
Jun 4, 2005, 5:02:12 AM6/4/05
to
David
 
You could put something like this in the workbook_BeforeSave() event
 
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Worksheets("Sheet1").Range("A1").Value = Format(Now(), "dd/mm/yyyy")
End Sub
 
It sets the date in cell A1 on Sheet1. (In UK Format)
 
To implement, look here
 

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
nick_hodge...@zen.co.uk.ANDTHIS
 
 
Message has been deleted

AIPL HO DEPT

unread,
Feb 21, 2009, 6:26:30 AM2/21/09
to
Dear Friend

Append following code to the before save event of work book in the VBA
editor

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)

Range("A1").Value = Format((Now()), "DD/MMM/YY")
'where "A1" is cell address
End Sub

Open VBA editor by clicking ALT+11 if you are new to VBA programming and
select this work book and append the above code

Hope this will solve your problem

Regards

Ramesh Shetty

"Capt. Cave Man" <ItIsSoEasyAC...@upyers.org> wrote in message
news:98ioo4tj3r2q2v67u...@4ax.com...

> Right click on the file itself and select 'properties'. Examine the
> 'details' tab, and you can find a "date last saved" field. There is also
> a 'date mofified' field.
>
> There is a way to use that data as you open the file in excel to update
> an included "last edited" field you define on the sheet.


0 new messages