Hi,
I have below two Private Sub Worksheet_Change, how can i merge for two logic
1st VBA
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A3:A5000")) Is Nothing Then Exit Sub
Application.EnableEvents = False
With Target
.Offset(, 2).Value = Date
.Offset(, 3).Value = Time
.Offset(, 4).Value = Environ("username")
End With
Application.EnableEvents = True
End Sub
2nd VBA
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("B3:B5000")) Is Nothing Then Exit Sub
Application.EnableEvents = False
With Target
.Offset(, 4).Value = Date
.Offset(, 5).Value = Time
.Offset(, 6).Value = Environ("username")
End With
Application.EnableEvents = True
End Sub
I have below two Private Sub Worksheet_Change, how can i merge for two logic
1st VBA
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A3:A5000")) Is Nothing Then Exit Sub
Application.EnableEvents = False
With Target
.Offset(, 2).Value = Date
.Offset(, 3).Value = Time
.Offset(, 4).Value = Environ("username")
End With
Application.EnableEvents = True
End Sub
2nd VBA
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("B3:B5000")) Is Nothing Then Exit Sub
Application.EnableEvents = False
With Target
.Offset(, 4).Value = Date
.Offset(, 5).Value = Time
.Offset(, 6).Value = Environ("username")
End With
Application.EnableEvents = True
End Sub