View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
urkec urkec is offline
external usenet poster
 
Posts: 131
Default adding command button to menu

Sub AddMacro()

Set bar = CommandBars("Standard")
Set ctl = bar.Controls _
.Add(Type:=msoControlButton)

ctl.Caption = "Run my macro"
ctl.Style = msoButtonCaption

'Macro to run
ctl.OnAction = "MyMacro"

End Sub

--
urkec


"excel-tr" wrote:

Hi,

how can I add a command button to standart excel toolbar.When I click it a
macro will work.

regards.
--
SAHRAYICEDIT-ISTANBUL