Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How can I add controls to a toolbar, using VBA code?
|
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This will add a new control to the worksheet menu bar:
Sub NewControl() Dim cmd As CommandBarButton Set cmd = Application.CommandBars("Worksheet Menu Bar"). _ Controls.Add With cmd .BeginGroup = True .Caption = "My New &Button" .Style = msoButtonCaption .BeginGroup = True .OnAction = "Insert Macro Name Here" End With OnExit: Set cmd = Nothing End Sub -- Kevin Backmann "joe" wrote: How can I add controls to a toolbar, using VBA code? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I was a bit too fast with the mouse click.
The .Caption statement is the name of your command with the ampersand indicating which letter is the hot-key. And the OnAction statement is the name of the macro you want to execute when the user clicks the button. -- Kevin Backmann "joe" wrote: How can I add controls to a toolbar, using VBA code? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Are all properties of controls on ctrl toolbox toolbar accessable? | Excel Programming | |||
adding controls to userform at runtime | Excel Programming | |||
Adding controls to userform | Excel Programming | |||
Is it possible to disable two or more controls from the same toolbar, when those cont | Excel Programming | |||
Help with adding controls | Excel Programming |