In the code below I am having an issue with some of the coding. I want the user name to show in column B and I want column B to clear if the user deletes or clears the info in column A. But at the same time I don't want the user to clear column B if there is an entry in column A.
Any help would be much appreciated. Thank You
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo Catch
'// Prevent any changes firing this event again
Application.EnableEvents = False
'// Change the '1' to ignore any heading rows
1 If Target.Row > 1 Then
'// Which column was changed?
Select Case Target.Column
'// A
Case 1
Target.Offset(, 1).Value = "Changed By " & UserName & " on " & Date & " @ " & Time
Case 2
'// Prevent user changes to Col B
Application.Undo
Beep
End Select
End If
Catch:
'// Make sure event handling turned on again
Application.EnableEvents = True
End Sub
Any help would be much appreciated. Thank You