View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Automatically enter today's date as a static entry

Use this then

Worksheets("Sheet1").Range("A1").Value = Format(Date, "mmm dd yyyy")


--
Regards Ron de Bruin
http://www.rondebruin.nl



"David" wrote in message ...
Thanks Peter, yours seems to have worked best of all the solutions I received. The others may have worked just as well if I knew
more about VB.

Can I take care of formatting so it ends up as March 12, 2005 in your code vs. in the spreadsheet?

Thanks again for your help.

"Peter T" <peter_t@discussions wrote in message ...
Hi David,

in the ThisWorkbook module -

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

'if don't want date if no changes since last save
If ThisWorkbook.Saved = True Then Exit Sub

On Error Resume Next
Application.EnableEvents = False
Worksheets("Sheet1").Range("A1") = Now
Worksheets("Sheet1").Range("A2") = Date
Application.EnableEvents = True

End Sub

Handy keyboard short cuts
Ctrl ;
semicolon - date
with shift or colon - time

Regards,
Peter T

PS FYI, my newsreader removed an attachment from your post it decided was
unsafe.

"David" wrote in message
...
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.