ADD A LAST UPDATE CELL TO A SPREAD SHEET

DarbyBrown

New Member
Joined
Jan 22, 2016
Messages
31
Office Version
  1. 365
Platform
  1. Windows
I am having trouble adding a ‘Last Update’ cell to my worksheet. The things I have tried are:

First, Used the VS editor and created a module, (Alt-F11):
Function ModDate()
ModDate = Format(FileDateTime(“MyFileName.xlsm”))
‘With and without the quote marks’
End Function

Then called the function in the cell formula
=ModDate()
The cell displays #VALUE!

Second, I tried to put the Formula directly in the cell:

=Format(FileDateTime(“MyFileName.xlsm”, “m/d/yy”))
The cell displays “$NAME?

Then, I changed the Module formula to:

ModDate = FileDateTime(“MyFileName.xlsm”)
(I also tried this formula directly in the cell)

The cell displays $VALUE!

What am I doing wrong???
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
requires the full path
So for the workbook containing the formula ...
VBA Code:
Function ModDate()
    ModDate = Format(FileDateTime(ThisWorkbook.path & "\" & ThisWorkbook.Name))
End Function

To find date for a different workbook
VBA Code:
    ModDate = Format(FileDateTime("D:\folder\ path\ to other workbook" & "\" & "MyFileName.xlsm"))
 
Upvote 0
thanks for your feedback (y)
I spoke a bit too soon, the formula did work as I needed it to except for one thing. I may go into the Workbook but not make any changes to the data, so I don't want the Last Update to change. With this formula the date changes every time I open the workbook. I only want it to update when I make any change to the data. Is this possible?
 
Upvote 0
perhaps
.. do not save the file
... open it read only
 
Upvote 0
Solution

Forum statistics

Threads
1,214,991
Messages
6,122,628
Members
449,095
Latest member
bsb1122

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top