Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
David
 
Posts: n/a
Default today's date in excel

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.
  #2   Report Post  
R.VENKATARAMAN
 
Posts: n/a
Default

after entering today() did you try copying this and pastespecial(values) on
the same cell
==============================
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.




  #3   Report Post  
Dave Peterson
 
Posts: n/a
Default

First, I find it easier to read messages when they're posted in plain
text--instead of HTML. Lots of people like plain text in this text only
newsgroup.

But you could use a workbook event that changes the date each time you save the
workbook.

Rightclick on the excel icon (to the left of the File option on the worksheet
menu bar).

Select view code and paste this in the code window:

Option Explicit
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Application.EnableEvents = False
With Me.Worksheets("sheet1").Range("a1")
.Value = Date
.NumberFormat = "mm/dd/yyyy"
End With
Application.EnableEvents = True
End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

You can read more about events at:
Chip Pearson's site:
http://www.cpearson.com/excel/events.htm

David McRitchie's site:
http://www.mvps.org/dmcritchie/excel/event.htm

David wrote:

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.


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? Richard Excel Discussion (Misc queries) 2 May 13th 23 11:46 AM
Excel Query Wizard Date Format aldsv Excel Discussion (Misc queries) 1 May 31st 05 12:44 PM
how to make excel select todays date from a list sococr Excel Worksheet Functions 1 February 27th 05 07:02 PM
Excel formula with date constraints Warrior Pope Excel Discussion (Misc queries) 3 January 28th 05 03:08 PM
Excel 2002 date formulas problem Andrew Warren Excel Worksheet Functions 4 January 6th 05 11:35 AM


All times are GMT +1. The time now is 09:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"