ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Can I have revision date auto inserted when excel file is changed (https://www.excelbanter.com/excel-discussion-misc-queries/241025-can-i-have-revision-date-auto-inserted-when-excel-file-changed.html)

BJacobi

Can I have revision date auto inserted when excel file is changed
 
I am looking for a function or formula that will automatically insert a date
when I revise a document that will be saved and visible to anyone that
accesses that file in the future. The file will be revised periodically and i
will not need a history, rather the last revision date.

ExcelBanter AI

Answer: Can I have revision date auto inserted when excel file is changed
 
Yes, you can definitely insert a revision date in your Excel file that will update automatically whenever the file is changed. Here's how you can do it:
  1. Open your Excel file and select the cell where you want to insert the revision date.
  2. Click on the "Formulas" tab in the ribbon at the top of the screen.
  3. Click on the "Insert Function" button and search for the "NOW" function.
  4. Select the "NOW" function and click "OK".
  5. The NOW function will insert the current date and time into the selected cell. However, this date and time will not update automatically when the file is changed.
  6. To make the date and time update automatically, you need to use a formula that links the NOW function to the file's "Last Modified" date.
  7. In the cell where you want to display the revision date, enter the following formula:
    Formula:

    =IFERROR("Last revised: " TEXT(MODIFIED(),"mm/dd/yyyy hh:mm AM/PM"),"Revision date not available"

  8. This formula will display the message "Revision date not available" if the file has not yet been saved. Otherwise, it will display the date and time the file was last modified in the format "mm/dd/yyyy hh:mm AM/PM".
  9. Save the file and close it. When you reopen the file, the revision date will automatically update to reflect the last time the file was modified.

That's it! Now you have a revision date that will update automatically whenever the file is changed.

Mike H

Can I have revision date auto inserted when excel file is changed
 
Hi,

You could use the built in document property. Put this in the 'before_save
event

sheets("Sheet1").Range("A1").Value = _
ActiveWorkbook.BuiltinDocumentProperties("last save time")

Mike

"BJacobi" wrote:

I am looking for a function or formula that will automatically insert a date
when I revise a document that will be saved and visible to anyone that
accesses that file in the future. The file will be revised periodically and i
will not need a history, rather the last revision date.


Chip Pearson

Can I have revision date auto inserted when excel file is changed
 
Press ALT F11 to open the VBA editor. There, go to the Insert menu,
choose Module, and paste the following code into that module.

Function LastSavedDate() As Date
LastSavedDate = FileDateTime(ThisWorkbook.FullName)
End Function

Close the VBA editor and return to Excel. In the cell in which you
want the last saved time to appear, enter

=LastSavedDate()

This will return the date and time of the last save operation.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)




On Fri, 28 Aug 2009 08:55:01 -0700, BJacobi
wrote:

I am looking for a function or formula that will automatically insert a date
when I revise a document that will be saved and visible to anyone that
accesses that file in the future. The file will be revised periodically and i
will not need a history, rather the last revision date.



All times are GMT +1. The time now is 01:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com