Can you format a button?

  • Thread starter Thread starter mevetts
  • Start date Start date
M

mevetts

Hi,

Is it possible to format a button so that it isn't a dull grey square!

Thanks,

Mark.
 
Mark,

If it is a Command Button (ActiveXControl) you can change the
background, font etc... Enter design mode, right click on the Command
Button and select Properties. Change the Back Color, Font etc...

If it is a Form Button, you can only change the font. Right click,
Format Control.

Cheers,

Steve
 
mevetts said:
Hi,

Is it possible to format a button so that it isn't a dull grey square!

Thanks,

Mark.

Yes, right click : properties : back colour : and pick your colour from the
palette.

Peter
 
Thanks for the help so far.

Is it possible to alter the colour (background) of a forms button?

Or perhaps I should be uisng some sort of ActiveX button?

Also, just wondering if you can attach an existing macro to a Active
button, it seems that you have to manually copy the code from a macr
into the VBA area. Even then I couldn't get it to work, the butto
didn't seem to 'embed' into the worksheet!

Thanks for any help.

Mark
 
Mark,

After pasting in the code, did you exit Design Mode before attempting
to select the box?
 
I remember closing all the floating menus, but that didn't make any
difference. Would this have exited me from design view or have you got
to do something more specific?
 
Also, I have firgured out hoe to attached a macro to a forms button, but
it doesn't seem obvious for a commmand button.

Am I missing a trick here?
 
I assume that you have already recorded the macro.

Go to Tools/Macro/Visual Basic Editor

The VBA Project Explorer should be in the left margin. If not, go to
View/Project Explorer.

Expand VBAProject (Your workbook name).

Expand Microsoft Excel Objects

Select the sheet that your command button is in. Select View/Code.
Since you haven't assigned anything it should just show.

Private Sub CommandButton1_Click()

End Sub

Type in the name of your Macro between the two lines so the code now
reads.

Private Sub CommandButton1_Click()
Macro 1
End Sub

X out of that and VB Editor. Exit design mode. Select your Command
button and it should run your macro.

Cheers,

Steve
 
That's great Steve, thanks for your help. I knew their must have been a
way without having to cut and paste all the code.

Presumably yo just substitute the 'MAcro 1' for the name if it is saved
as something specific.

Thanks again.
 
No problem and yes, just change "Macro1" to whatever the specific
macro's name is.

Cheers,

Steve
 

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

Back
Top