How can display the last modified date and time of my excel file in a particular cell - Say in cell E1.
This is the same value that we get when we Right Click excel file->Properties->General and look at the label "Modified".
How can display the last modified date and time of my excel file in a particular cell - Say in cell E1.
This is the same value that we get when we Right Click excel file->Properties->General and look at the label "Modified".
I do blog at http://blogs.koolwal.net
How to use the macro:
1. Open up your workbook
2. Right-click the Excel icon to the left of FILE Menu
3. Select VIEW CODE
4. Copy and Paste in your code (given below) in the ThisWorkbook module that appears
5. Get out of VBA (Press Alt+Q)
6. Save your sheet
The macro is installed and ready to use. When you save your sheet, the current time stamp will be updated in cell E1.
![]()
Please Login or Register to view this content.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
?None of us is as good as all of us? - Ray Kroc
?Actually, I *am* a rocket scientist.? - JB (little ones count!)
So I tried the above code, but it does not work. I don't get any time stamp when I close and re-open the file. The cell E1 is blank.
I am using Excel 2002 version. I am attaching a sample file with the VBA code in it (Sheet1).
code needs to go in workbook module not work sheet module
"Unless otherwise stated all my comments are directed at OP"
Mojito connoisseur and now happily retired
where does code go ?
look here
how to insert code
how to enter array formula
why use -- in sumproduct
recommended reading
wiki Mojito
how to say no convincingly
most important thing you need
Martin Wilson: SPV
and RSMBC
Sorry I take my words back. It didn't quite do what I was hoping for it.
The current code updates the time stamp even if I don't modify the file. Looks like it is showing the last access/open time instead of the last modified date.
I am looking for the last modified time as mentioned in my first post.
Move the code to the BeforeSave event (still goes in the ThisWorkbook module).
![]()
Please Login or Register to view this content.
Entia non sunt multiplicanda sine necessitate
Edit...deleted as unnecessary.
I stumbled upon this thread not too long ago and it pointed me in the right direction, but I'm not sure it completely answered the question. Basically, you can create your own function using the Visual Basic side of Excel. From there, you can call on the function in any cell you'd like and it will display the modified date of the file. Here's the function:
I made a quick post about this in my blog with instructions on how to add it, for those of you that may need a full tutorial.![]()
Please Login or Register to view this content.
http://danblee.com/display-modified-date-of-excel-file/
Cheers!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks