I am attempting to use an Active X control button to change the background (fill) color of a range of cells when the button is clicked and then change it back to its original color when clicked again. The code I have returns errors. I am looking for a simple solution.
Basic Idea:
Private Sub CommandButton3_Click()
If Intersect(target, Range("M3, 03:Z3")) Is Nothing Then Exit Sub
If target.Interior.ColorIndex = RGB(252, 228, 214) Then
target.Interior.ColorIndex = 6
ElseIf target.Interior.ColorIndex = 6 Then
target.Interior.ColorIndex = RGB(252, 228, 214)
End If
End Sub