Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Last Update Date

Posted on 2011-02-20
7
Medium Priority
?
264 Views
Last Modified: 2012-05-11
I have a spreadsheet and each time I open it it displays the current date.  I'd like a command or small macro that places in the cell below the current date the date the spreadsheet was last worked on.  If I use a simple copy/paste, it too will auto update each time I open the sheet.  Just to be clear, when the sheet is closed and then reopened a new date time will be established and the old one moved into the "date spreadsheet was last worked on".

Hard or easy?

B.
0
Comment
Question by:Bright01
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 37

Accepted Solution

by:
Neil Russell earned 2000 total points
ID: 34936685
Use the following code


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
   Sheets("Sheet1").Range("A1").Value = Date
End Sub

Open in new window

0
 
LVL 37

Expert Comment

by:Neil Russell
ID: 34936693
Oh and of course change "sheet1" and "A1" to reflect the sheetname and cell that you want the date stored in.
0
 

Author Comment

by:Bright01
ID: 34936735
Neilsr,

I'm not sure what I'm doing wrong..... I cut/pasted your code into the Company_Profile tab in the Developer's tab, changed the spreadsheet name and the cell reference and saved/closed the workbook.  When I opened it....nothing.  I'm running 2010 if that makes any difference and I do have macros enabled............ any ideas?

B.
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 

Author Comment

by:Bright01
ID: 34936739
Oh... changed it to "This Workbook" and it worked great!  Much thanks.

B.
0
 

Author Closing Comment

by:Bright01
ID: 34936740
By the speed and simplicity, I'll take it as a "yes" that was easy!

Thanks,

B.
0
 
LVL 37

Expert Comment

by:Neil Russell
ID: 34936741
Developers tab, visual basic, paste code into This Workbook
0
 
LVL 37

Expert Comment

by:Neil Russell
ID: 34936743
Glad to be of help
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question