Jeet_Dhillon
New Member
- Joined
- Jul 13, 2019
- Messages
- 19
Hello Friends,
I am using this code for auto inserting date and username when a cell value is changed.
I need when "Done" is selected from the dropdown list,auto-insert should trigger, but now auto-insert is for all the Values.
Please share some suggestions
thanks.
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo Handler
If Target.Column = 2 Or Target.Column = 4 Or Target.Column = 6 Or Target.Column = 8 And Target.Value <> "" Then
Application.EnableEvents = False
Target.Offset(0, 0) = Format(Now(), "dd-mm-yy/") & Environ("UserName")
Application.EnableEvents = True
End If
Handler:
End Sub
I am using this code for auto inserting date and username when a cell value is changed.
I need when "Done" is selected from the dropdown list,auto-insert should trigger, but now auto-insert is for all the Values.
Please share some suggestions
thanks.
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo Handler
If Target.Column = 2 Or Target.Column = 4 Or Target.Column = 6 Or Target.Column = 8 And Target.Value <> "" Then
Application.EnableEvents = False
Target.Offset(0, 0) = Format(Now(), "dd-mm-yy/") & Environ("UserName")
Application.EnableEvents = True
End If
Handler:
End Sub