Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Last Saved date in cell (Excel 2002/2003)

    Hi

    I know you can have the last saved date in a header or footer, is it possible to have it in a cell in a worksheet?

    Regards

    Braddy
    If you are a fool at forty, you will always be a fool

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Last Saved date in cell (Excel 2002/2003)

    Option 1: put the following code in the ThisWorkbook module:

    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    Worksheets("Sheet1").Range("A1") = Now
    End Sub

    Advantage: the date/time will be updated automatically.
    Disadvantage: the date/time will also be updated if the user starts to save, but cancels, so the value may not always be correct.

    Option 2: create a custom function in a standard module:

    Function SavedDate(oCell As Range) As Date
    SavedDate = oCell.Parent.Parent.BuiltinDocumentProperties("Las t Save Time")
    End Function

    And use like this in a cell formula:

    =SavedDate(A1)

    and format the cell as desired.

    Advantage: will display the correct save date.
    Disadvantage: the formula will not update itself unless the specified cell changes. You could change the definition to

    Function SavedDate(oCell As Range) As Date
    Application.Volatile
    SavedDate = oCell.Parent.Parent.BuiltinDocumentProperties("Las t Save Time")
    End Function

    This will make the formula update whenever a calculation occurs.

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: Last Saved date in cell (Excel 2002/2003)

    Hi Hans

    Thank you for such a comprehensive reply, I will check all your options to find the best for me.

    Regards

    Braddy
    If you are a fool at forty, you will always be a fool

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •