Button Color

Drmwvr7266

Board Regular
Joined
Apr 7, 2002
Messages
164
I have a userform that I created. Is there a way to change the color once the button has been clicked?

I'm sure if I had a checkbox, which has true and false, I could change from one color to another depending on the status of checked or not.

However, with the command button, I'm not sure. If I clicked it once, it would most likely stay the new color.

Example:

Commandbutton1 'Standard gray

Commandbutton_click
'changes to blue.

This way, the user would know if that function had been performed.

G
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Try this

Private Sub CommandButton1_Click()
CommandButton1.BackColor = &HFF8080
End Sub

HTH,
Regards, Tom
 
Upvote 0
Depending on your application, it might also be possible for you to use a ToggleButton instead of a Command button. The ToggleButton has a Value property of TRUE FALSE
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,583
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top