Hello all, I am a first time user of this forum. My question is as follows: I have a data entry table from Column A to Column Q, then I have this VBA code below.
The code creates an automatic date and time stamp in columns S and T when a new entry is first made in any cell in of a particular row in the worksheet, and when any entry on that row is updated or changed. Could someone help with editing the VBA code to include in column U
an automatic records the username of the last person to update any of the cells in columns A to Q?
Thank you all.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim myTableRange As Range
Dim myDateTimeRange As Range
Dim myUpdatedRange As Range
'Your data table range
Set myTableRange = Range("A2:P1000000")
'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("S" & Target.Row)
'Column for last updated date/time
Set myUpdatedRange = Range("T" & 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
The code creates an automatic date and time stamp in columns S and T when a new entry is first made in any cell in of a particular row in the worksheet, and when any entry on that row is updated or changed. Could someone help with editing the VBA code to include in column U
Thank you all.