VBA to change color of Forms Control Button

hcgood

New Member
Joined
Jun 30, 2006
Messages
22
I have a spreadsheet with very simple ActiveX control button to hide, show columns, and some other buttons for other simple purposes.
But my org would like this to run on Mac as well so I'm trying to switch over to Forms Controls. I know little about coding, tho wish I knew more.
I can't believe that after 25 plus years MS still doesn't make this a simple property on the button to make it easy to change!

Can anyone help with some simple VBA code to change the background color of the button to match what I have on the ActiveX button. The color change will be permanent, not contingent on other cells.

I found some code that changes background color on a Checkbox as it is checked or unchecked so it seems the Button color should be able to be changed as well. But can't figure out how to adapt that code for a Button.
Any help would be appreciated. Would like it to have RGB in the code so I can fine tune the color of the button.

Thanks in advance for any help out there.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Are using shapes an option? Insert any kind of shape, you can color/format it as much as you want.
Then just assign a macro to it.
 
Upvote 0
Solution
Everything has evolved over time. Shapes have gotten better and more versitile. The form/activeX controls are from way back and have not been improved/developed.
Glad it worked. Not sure if you meant text box but you can use rectangles and add icons to it. Group the shape and you have a pretty decent button look.
 
Upvote 0
Everything has evolved over time. Shapes have gotten better and more versitile. The form/activeX controls are from way back and have not been improved/developed.
Glad it worked. Not sure if you meant text box but you can use rectangles and add icons to it. Group the shape and you have a pretty decent button look.
Helpful explanation about 'up and coming' Shapes.
I did mean text box because I needed a title in it, but now, based on what you say about rectangle, I see I can also add a formula to that - fantastic.

Very much appreciate your help.
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,117
Members
453,021
Latest member
Justyna P

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