Thread: Command button
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Command button

Nick,

I presume you mean in Excel, not on a userform?

Three ways:

Make sure the Forms menu is open (ToolsCustomizeToolbars), click the
button control, then on the worksheet right-click and size the button. You
will immediately be presented with a dialog box to assign a macro to he
button.

OR

Make sure the Control Toolbox toolbar is open (same way), click the button
control, then on the worksheet right-click and size the button. Then double
click the button and you will be taken to the VBE with a button click event
macro set-up where you can call your macro, or even add the code there.
Click the Design mode button on this control to exit Design.

OR

Add a button to a toolbar (ToolsCustomizeCommands) and select the Macros
option, then drag either the smiley or the text item onto an existing
toolbar. Right click the new button, and there is an option to assign a
macro.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Nick" wrote in message
...
Hi,

Can anyone tell me how to insert a command button that
will initiate a macro?

Thanks in advance,

Nick