I have created a spreadsheet with command buttons that change color when selected or deselected.
I would like to have the text of the commannd button change as well. When the button is green I would like the text to read "YES", when the button is red, I would like the text to read "NO". My expertise is limited to very basic, simple code, so any help would be appreciated. Here is the code I am using now.
Private Sub CommandButton1_Click()
If CommandButton1.BackColor = vbGreen Then
CommandButton1.BackColor = vbRed
Else
CommandButton1.BackColor = vbGreen
End If
End Sub
I would like to have the text of the commannd button change as well. When the button is green I would like the text to read "YES", when the button is red, I would like the text to read "NO". My expertise is limited to very basic, simple code, so any help would be appreciated. Here is the code I am using now.
Private Sub CommandButton1_Click()
If CommandButton1.BackColor = vbGreen Then
CommandButton1.BackColor = vbRed
Else
CommandButton1.BackColor = vbGreen
End If
End Sub