I'm a newb here, so thanks in advance for the help and patience.
I'm using the script below to provide the time and date when information is entered in an adjacent cell. Works like a charm. However, I want the script to also work for cells a few columns over, such as Column F, for example, placing the time and date information in the same row the next column over. I don't have a clue how to get this to repeat, or if I need to add a new script, or if so, how to add a new one...
Again, thanks for any and all help....here's the script:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count > 1 Then Exit Sub
If Not Intersect(Range("A2:A10"), .Cells) Is Nothing Then
Application.EnableEvents = False
If IsEmpty(.Value) Then
.Offset(0, 1).ClearContents
Else
With .Offset(0, 1)
.NumberFormat = "dd mmm yyyy hh:mm:ss"
.Value = Now
End With
End If
Application.EnableEvents = True
End If
End With
End Sub
I'm using the script below to provide the time and date when information is entered in an adjacent cell. Works like a charm. However, I want the script to also work for cells a few columns over, such as Column F, for example, placing the time and date information in the same row the next column over. I don't have a clue how to get this to repeat, or if I need to add a new script, or if so, how to add a new one...
Again, thanks for any and all help....here's the script:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count > 1 Then Exit Sub
If Not Intersect(Range("A2:A10"), .Cells) Is Nothing Then
Application.EnableEvents = False
If IsEmpty(.Value) Then
.Offset(0, 1).ClearContents
Else
With .Offset(0, 1)
.NumberFormat = "dd mmm yyyy hh:mm:ss"
.Value = Now
End With
End If
Application.EnableEvents = True
End If
End With
End Sub