Form Control Button Color

  • Thread starter Thread starter Richard
  • Start date Start date
R

Richard

How can I change the color of the button? I can change the font style and
color but cannot find how to change the button color.
 
With buttons from the forms toolbar you can not change the colour of the
button. To do that you need to use a button from the control toolbox. That
will require a single line of code to make everything work...
 
I'm using the button to assign a macro. I was asked to make it more visible,
the light gray kind of disappears in the white background.
 
Add a new command button from the control toolbox. Right click the button and
select Properties. A Properties window will open up allowing you to change
the Caption, Font, Fore Colour (font), and Background Colour (button). If you
double click on the button it will take you into the VB editor with a code
stub that looks something like this...

Private Sub CommandButton1_Click()

End Sub

Add a line of code so that you end up with this
Private Sub CommandButton1_Click()
Call MyMacroName 'the name of your recorded macro
End Sub

Go back to XL and get out of design mode by clicking the Triangle and Ruler
icon on the control toolbox. Your new button should now be looking and
working the way you want it to.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top