how to change the appearance of command button

M

Mighty Magpie

I have used command buttons to activate a few macro's and they work fine.

Is it possible to change the colour of a command button from the boring grey
to something, well, more colourful?
 
T

Tod

If you are using an ActiveX Command Button you can change
the BackColor property from the Properties list but your
choices are mostly just various shades of grey. You can
have more control over the color if you change it with
code, like this:

CommandButton1.BackColor = &HFF&

tod
 
M

Mighty Magpie

Having found that, how can I assign a Macro to that type of button - it
seems that the one(s) I have been using let me do that (assign a Macro) but
do not let me edit the properties
 
D

Dave Peterson

If you double click on that control (commandbutton), you'll see where you can
merge your code.

But another way is just to call it from that _click event.

Option Explicit
Private Sub CommandButton1_Click()
Call myOldMacroNameHere
End Sub

myOldMacroName would be a macro stored in a General module.
 

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

Top