I having an error when I press delete button over a merged cell (Type Mismatch 13), however, this error only shows when the cell is merged, otherwise, no error is raised and I cannot understand why, please follow down the code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target = Range("AG3") Then
If Target.Value = 5 Then
Sheets("Sheet6").CommandButton6.Visible = False
Else
Sheets("Sheet6").CommandButton6.Visible = True
End If
End If
On Error Resume Next
Sheets("Sheet6").CommandButton6.Visible = False
On Error GoTo 0
End Sub
What is missing?
The cell AG3 has a number that varies from 0 to 5