Handle Worksheet Change Event Based Error

Handle Worksheet Change Event-Based Error 


Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo err

'If Not Target.Cells.Address = "$C$8" Then Exit Sub

If Target.Cells.Address = "$C$8" And Target.Value = "All" Then

    Target.Offset(0, 1) = "All"

    Target.Offset(0, 2) = "All"

    Target.Offset(0, 3) = "All"

ElseIf Target.Cells.Address = "$D$8" And Target.Value = "All" Then

    Target.Offset(0, 1) = "All"

    Target.Offset(0, 2) = "All"

ElseIf Target.Cells.Address = "$E$8" And Target.Value = "All" Then

    Target.Offset(0, 1) = "All"

End If

err:

Exit Sub

End Sub


Comments

Popular posts from this blog

Power Automate - Automatically fetch data from Power BI in to Excel and Send the copy of the Excel file via Email

Separate Text (Characters) & Numbers from Alpha Numeric String Using Formula and Macro (VBA)

File System Object