Display Last Saved Date on worksheet

后端 未结 5 1156
你的背包
你的背包 2021-01-07 19:06

Does anyone know how to display the Last Saved Date of an Excel Spreadsheet on one of the worksheets?

I have found ways to do it using macros, but the spreadsheet is

相关标签:
5条回答
  • 2021-01-07 19:27

    thought I would update on this.

    Found out that adding to the VB Module behind the spreadsheet does not actually register as a Macro.

    So here is the solution:

    1. Press ALT + F11
    2. Click Insert > Module
    3. Paste the following into the window:

    Code

    Function LastSavedTimeStamp() As Date
      LastSavedTimeStamp = ActiveWorkbook.BuiltinDocumentProperties("Last Save Time")
    End Function
    
    1. Save the module, close the editor and return to the worksheet.
    2. Click in the Cell where the date is to be displayed and enter the following formula:

    Code

    =LastSavedTimeStamp()
    
    0 讨论(0)
  • 2021-01-07 19:30

    This might be an alternative solution. Paste the following code into the new module:

    Public Function ModDate()
    ModDate = 
    Format(FileDateTime(ThisWorkbook.FullName), "m/d/yy h:n ampm") 
    End Function
    

    Before saving your module, make sure to save your Excel file as Excel Macro-Enabled Workbook.

    Paste the following code into the cell where you want to display the last modification time:

    =ModDate()
    

    I'd also like to recommend an alternative to Excel allowing you to add creation and last modification time easily. Feel free to check on RowShare and this article I wrote: https://www.rowshare.com/blog/en/2018/01/10/Displaying-Last-Modification-Time-in-Excel

    0 讨论(0)
  • 2021-01-07 19:33

    There is no built in function with this capability. The close would be to save the file in a folder named for the current date and use the =INFO("directory") function.

    0 讨论(0)
  • 2021-01-07 19:42

    You can also simple add the following into the Header or Footer of the Worksheet

    Last Saved: &[Date] &[Time]

    0 讨论(0)
  • 2021-01-07 19:47

    May be this time stamp fit you better Code

    Function LastInputTimeStamp() As Date
      LastInputTimeStamp = Now()
    End Function
    

    and each time you input data in defined cell (in my example below it is cell C36) you'll get a new constant time stamp. As an example in Excel file may use this

    =IF(C36>0,LastInputTimeStamp(),"")
    
    0 讨论(0)
提交回复
热议问题