I need to display the date and time a spreadsheet was last saved each time the sheet is opened. I use the following function and incorporate it as shownThe problem is that when the file is opened is displayes the current date and time not the last time the file was saved.Code:Public Function myDate() myDate = Format(FileDateTime(Application.ActiveWorkbook.FullName), "mm/dd/yyyy h:n ampm") End Function Private Sub Workbook_Open() Sheet1.Range("D38") = myDate End Sub
How would I fix this?
I've done a fair amount of Googling about as well as looking through the Excel VBA code here on VBF and the general consensus seems to be that using FileDateTime is the way to go....but it doesn't want to play the way Uncle Hack needs it to play.![]()


Reply With Quote

