Thread: Command button
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
hadrien hadrien is offline
external usenet poster
 
Posts: 1
Default Command button

Hello Nick,

Have you tried to use the macro recorder in
Tools/Macro/Record new macro ... ?

Record a macro with the recorder and add a button to any
existing commandbar - using the Customize... dialog,
picking a button and dropping it into a commandar, then
take it out and back onto the customize dialog. Once
you're done, you should be able to see a new module in
the VB Editor.

Use this code and the following one :

With CommandBars(Your commandbar name).Controls(your
control's index)
.Caption = (set the caption)
.OnAction = (name of the macro to be initiated
.FaceId = (set the appearance of the button)
End With

you should use the OnAction property.

-----Original Message-----
Hi,

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

Thanks in advance,

Nick
.