Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50061

Excel VBA Code to make all my Toggle Buttons Red if False and Green if True, easier way.

$
0
0
Is there a code to make all my Toggle Buttons turn “Red” is their value is “False” and “Green” if their value is “True”. Right now I’m having to code every Toggle Button with:

Code:

Private Sub zCX_Click()
If zCX.Value = True Then
zCX.BackColor = RGB(0, 255, 0)
Else
zCX.Value = False
zCX.BackColor = RGB(255, 0, 0)
End If
End Sub

There has got to be an easier way.

Viewing all articles
Browse latest Browse all 50061

Trending Articles