Hello all
Any idea on how could I change this VBA code:
(it clears certain cells content whenever a drop-down is changed in column 19/S)
So that instead of specifying the column
I could specify the exact cell?
I've tried something like
but not surprisingly it did not work since my VBA skills are quite limited
Thank you!
Any idea on how could I change this VBA code:
(it clears certain cells content whenever a drop-down is changed in column 19/S)
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
If Target.Column = 19 Then
If Target.Validation.Type = 3 Then
Application.EnableEvents = False
Target.Offset(0, 1).ClearContents
Range(Target.Offset(0, -17), _
Target.Offset(20, -17)).ClearContents
Range(Target.Offset(24, -17), _
Target.Offset(44, -17)).ClearContents
Range(Target.Offset(48, -17), _
Target.Offset(68, -17)).ClearContents
End If
End If
exitHandler:
Application.EnableEvents = True
Exit Sub
End Sub
VBA Code:
If Target.Column = 19 Then
I've tried something like
VBA Code:
If Target.Address = "S2" Then
Thank you!