How do I change the color of an Excel button?

In Excel I've inserted a "button" and assigned it to a macro.  How do I change the face color of the button?  I'd like to change the face color from grey to blue.  Or better yet can I insert a picture onto the face of the grey button?  
LVL 1
shaolinfunkAsked:
Who is Participating?
 
Hitesh ManglaniCommented:
double click Thisworkbook in the left pane, then on your right pane in the left combobox select workbook, in the right combobox select open.Then type my code
0
 
Hitesh ManglaniCommented:
use this
Sheet1.CommandButton1.ForeColor = RGB(255,0,0)
0
 
Hitesh ManglaniCommented:
sorry misunderstood
Sheet1.CommandButton1.Picture = LoadPicture("C:\hithtml\Prairie Wind.bmp")
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
shaolinfunkAuthor Commented:
Where do I insert that code?

When I edit a macro from within Excel it brings me into a module within Visual Basic...the module is filled with "Sub" routines...
0
 
Hitesh ManglaniCommented:
Put this code in a separate module and run the macro, or you can put it in any of your macros
0
 
shaolinfunkAuthor Commented:
So to "color" the buttons I have to hit a macro button to run the code?

Is there a way to have the buttons be colored as soon as the Excel file is opened? i.e. the buttons are blue to start with, and i don't have to push a macro button to make them blue...
0
 
shaolinfunkAuthor Commented:
Also, the debugger highlighted "CommandButton1" with a "method or data member not found" error...how do I find out what the name of the grey button is?
0
 
Hitesh ManglaniCommented:
put the code in the workbook open event
Private Sub Workbook_Open()
Sheet1.CommandButton1.Picture = LoadPicture("C:\hithtml\Prairie Wind.bmp")

End Sub
0
 
Hitesh ManglaniCommented:
The name of the button can be found by right clicking the button and clicking on properties
0
 
shaolinfunkAuthor Commented:
right clicking the button and clicking on properties is not possible from witihin excel....there's no properties option...
0
 
shaolinfunkAuthor Commented:
also, after editing the macro from within excel i cannot find the open workbook event...where is that?  thanks for your help..
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.