sassriverrat
Well-known Member
- Joined
- Oct 4, 2018
- Messages
- 655
So I have two CMD buttons in a userform that change the the value of a cell. I'd like the cmd button that is clicked to turn green and the other to stay its boring white- and if the other button is pushed, the first to change back to white and the other to go green- essentially letting you know which is clicked.
Here's what I wrote for the first button and it didn't work. I was putting this code (obviously modified for the cell value and button] in each click sub for the buttons.
Thanks
Here's what I wrote for the first button and it didn't work. I was putting this code (obviously modified for the cell value and button] in each click sub for the buttons.
Code:
Private Sub Commandbutton1_Click()
Sheets("Sheet1").Range("A1").FormulaR1C1 = "'Yes"
If Sheets("Sheet1").Range("A1").Value = "'Yes" Then
Commandbutton1.BackColor = vbGreen
End If
Thanks