ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Time Date Stamp when range changes (https://www.excelbanter.com/excel-programming/383422-time-date-stamp-when-range-changes.html)

PZ[_3_]

Time Date Stamp when range changes
 
Worksheet has changeable data clients input in columns W to AP.
Looking for macro to time date stamp in column V in the same row each
time the data is changed anywhere in columns W to AP. Some inputs are
freeform text and numbers, some are from dropdown list.

Most of the postings show how to have one column update the next
column over such as http://www.mcgimpsey.com/excel/
timestamp1.html#alt1

the only way i could get it to work for any changes for all columns
was to run the test for each column which starts to take time.

Seems like there should be an easier way to post the data to column V
for each row that regardless of which column generated the change
event. Possilbe to change McGimpsey's code to accomplish this task?


JE McGimpsey

Time Date Stamp when range changes
 
One way:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count 1 Then Exit Sub
If Not Intersect(Range("W:AP"), .Cells) Is Nothing Then
On Error Resume Next
Application.EnableEvents = False
If IsEmpty(.Value) Then
.EntireRow.Cells(22).ClearContents
Else
With .EntireRow.Cells(22)
.NumberFormat = "dd mmm yyyy hh:mm:ss"
.Value = Now
End With
End If
Application.EnableEvents = True
End If
End With
End Sub


In article .com,
"PZ" wrote:

Worksheet has changeable data clients input in columns W to AP.
Looking for macro to time date stamp in column V in the same row each
time the data is changed anywhere in columns W to AP. Some inputs are
freeform text and numbers, some are from dropdown list.

Most of the postings show how to have one column update the next
column over such as http://www.mcgimpsey.com/excel/
timestamp1.html#alt1

the only way i could get it to work for any changes for all columns
was to run the test for each column which starts to take time.

Seems like there should be an easier way to post the data to column V
for each row that regardless of which column generated the change
event. Possilbe to change McGimpsey's code to accomplish this task?



All times are GMT +1. The time now is 03:53 AM.

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