Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display Date Modified

Status
Not open for further replies.

Caren

Technical User
Aug 12, 2000
27
US
The Date Modified appears in file properties. Is there any way to display the Date Modified in the report itself? I don't want it to change each time the file is opened. [sig][/sig]
 
Goto the VB editor, add a module, then add this code.

Function LastModifiedDate() As Date
LastModifiedDate = CDate(FileDateTime(ActiveWorkbook.FullName))
End Function

Then, select the cell on the worksheet in which you want the date to appear. Format the cell to the date format of your choice. Select Insert > Function. Pick the LastModifiedDate function and hit OK. OK the next screen as well. This will be updated everytime the sheet is recalculated.

Hope this helps! [sig][/sig]
 
If you're talking Word, just hit Insert-Field, date and time. On the right-hand column, select "Saved Date" because you wouldn't be saving the document if you hadn't made any changes, right? (Don't forget to hit options to see the way you want to display the date.)

This avoids VBA. [sig]<p> <br><a href=mailto:techsupportgirl@home.com>techsupportgirl@home.com</a><br><a href= </a><br> [/sig]
 
Well, what am I doing wrong? It doesn't update. When I first format the field it puts in the correct modify date, but then no matter what I change the date never changes again. If I copy that date field to another cell then I get the new modify date.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top