ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   how do i get the date and time if a change is done in a worksheet (https://www.excelbanter.com/excel-discussion-misc-queries/256359-how-do-i-get-date-time-if-change-done-worksheet.html)

Srini

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


Otto Moehrbach[_2_]

how do i get the date and time if a change is done in a worksheet
 
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
"srini" wrote in message
...


L. Howard Kittle

how do i get the date and time if a change is done in a worksheet
 
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

"srini" wrote in message
...





All times are GMT +1. The time now is 05:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com