-
[RESOLVED] Date Saved
I found this code, and of course I am unable to debug it. It hangs up at the Sheets("Index").range
I am trying to have a date cell that tells me the last time the workbook was saved, and not (like it is now) where it states right now. I am apparently supposed to put the now() statement in cell A1 of whatever worksheet, and have the Macro copy and paste values only into the cell where I want the last save date. Sounds simple, and I have this piece of code, but it's like trying to write german to me. I just don't have the vocabulary.
Sub Workbook_Open()
Sheets("Index").range ("A1") 'Cell where =Now() is
Selection.Copy
Active.Sheet.range("AA85").Select ' Target Cell
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False ' PasteSpecial value only
End Sub
-
Re: Date Saved
try
Sheets("Index").range ("A1") = ThisWorkbook.BuiltinDocumentProperties("last save time")
-
Re: Date Saved
this did something, but i can't read it. it says this:
40055.8210648148. How would I change this to a date format?
-
Re: Date Saved
format the cell
range("a1").numberformat = "dd/mm/yyyy"
-
Re: Date Saved
sometimes you just gotta laugh at yourself. ;-)
That worked.
How would I go about applying this to the active sheet being saved? Where would I put the code? On the sheet code it's self or in the workbook? right now I have to have a button assigned to it.
-
Re: Date Saved
workbook open event, is probably the best will update the last saved time when the workbook is opened, specify the the range with sheet name