Hej guys.
I have this little problem.
I would like to make it the same for every second row, but i cant figure out how to set the range correctly.
I want to type "x" in a random cell i column D or F, and the timesample will emerge one the cell to the right.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim B As Range: Set B = Range("B:B")
Dim v As String
If Intersect(Target, B) Is Nothing Then Exit Sub
Application.EnableEvents = False
v = Target.Value
If v = "x" Then Target.Offset(0, 1) = Now()
If v = "1" Then Target.Offset(0, 1) = Now()
Application.EnableEvents = True
End Sub
Hope you can helpo!
I have this little problem.
I would like to make it the same for every second row, but i cant figure out how to set the range correctly.
I want to type "x" in a random cell i column D or F, and the timesample will emerge one the cell to the right.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim B As Range: Set B = Range("B:B")
Dim v As String
If Intersect(Target, B) Is Nothing Then Exit Sub
Application.EnableEvents = False
v = Target.Value
If v = "x" Then Target.Offset(0, 1) = Now()
If v = "1" Then Target.Offset(0, 1) = Now()
Application.EnableEvents = True
End Sub
Hope you can helpo!