HI
I have a Macro script that when i have the input on column J, then both coolumn H & I will be updated automatically with the timestamp of when i input the column J. the macro worked perfectly.
Now i want to have similar Macro on column M ; when i input column M, both column K & L will be updated automatically with the timestamp.
Please help me to have 2 macros in the same workbook
I got the current macros from this youtube video : https://www.youtube.com/watch?v=gIPdx4-rqGg&t=663s&ab_channel=TeachExcel
The macros script :
Private Sub Worksheet_Change(ByVal Target As Range)
' Timestamp Data
' TeachExcel.com
Dim myTableRange As Range
Dim myDateTimeRange As Range
Dim myUpdatedRange As Range
'Your data table range
Set myTableRange = Range("J:J")
'Check if the changed cell is in the data tabe or not.
If Intersect(Target, myTableRange) Is Nothing Then Exit Sub
'Stop events from running
Application.EnableEvents = False
'Column for the date/time
Set myDateTimeRange = Range("H" & Target.Row)
'Column for last updated date/time
Set myUpdatedRange = Range("I" & Target.Row)
'Determine if the input date/time should change
If myDateTimeRange.Value = "" Then
myDateTimeRange.Value = Now
End If
'Update the updated date/time value
myUpdatedRange.Value = Now
'Turn events back on
Application.EnableEvents = True
End Sub
thank you