how do i get the date and time if a change is done in a worksheet

O

Otto Moehrbach

You don't give much to work with. The following macro, placed in the sheet
module, will put the date and time in A1. Format A1 for date and time.
Post back and provide more info on what you have and what you want. To
access the sheet module, right-click the sheet module and select View Code.
"X" out of the module to return to your sheet. HTH Otto
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Range("A1") = Now
Application.EnableEvents = True
End Sub
 
L

L. Howard Kittle

As Otto says, a bit short on info. However, if you want to have a date and
time record of every change that happens on the sheet, try this modified
version of Ottos code. Will list a date and time in column A for each
change of any cell, basically every time you hit enter or a calculation
takes place.

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Range("A100").End(xlUp).Offset(1, 0) = Now
Application.EnableEvents = True
End Sub

If 100 entries is not enough then up the ante to:

Range("A10000").End(xlUp).Offset(1, 0) = Now

HTH
Regards,
Howard
 

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

Top