I have a form with buttons on. I want them to change colour as they are clicked, to improve the contrast. I have the following code;
For Each TB In UserForm1.Controls
If TypeName(TB) = "ToggleButton" Then
Select Case TB.Value
TB.ForeColor = RGB(0, 255, 0)
TB.ForeColor = RGB(255, 0, 0)
Which I know works because I've attached it to a button to run. Where can I put it so that it runs every time a button is clicked, without having to repeat it for every single "Onclick" command?
I have been messing with;
Private Sub Worksheet_Change(ByVal Target As Range)
for the worksheet that contains the control source for all the buttons, but it doesn't seem to work.
Any miracle solutions?