Update upon entry

  • Thread starter Thread starter Robyn Bellanger
  • Start date Start date
R

Robyn Bellanger

I have a spreadsheet with numerous cells at the top of the page I have the
current date. Is there a way to have the date automatically change to the
current date any time a cell is edited/changed on the worksheet?

Any help is greatly appreciated!
 
Robyn
Copy the following event macro into the sheet module for that sheet. To
do this, right-click on the sheet tab, select View Code, and paste this
macro into that module. As written, this macro will insert the current date
and time into cell A1 if any cell on the entire sheet changes content. This
includes changing to blank.
Format A1 to display whatever you want, date or time or both. HTH Otto
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(0, 0) = "A1" Then Exit Sub
Application.EnableEvents = False
Range("A1") = Now
Application.EnableEvents = True
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top