Adding Controls in a toolbar?
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?
|