This is an example of creating a new button on the Worksheet menu bar. If
you wanted to use your own commandbar use the Commandbars.Add method.
Examples are in VBA Help and all over the web.
Sub AddBtn()
DelBtn
With CommandBars("Worksheet Menu Bar").Controls.Add(msoControlButton, ,
, , True)
.Caption = "CS_Override"
.TooltipText = "Mark/unmark selected range as override"
.OnAction = "MarkAsOverride"
.FaceId = 6743
.BeginGroup = True
End With
End Sub
Sub DelBtn()
On Error Resume Next
CommandBars("Worksheet Menu Bar").Controls("CS_Override").Delete
End Sub
--
Jim
| The macro is actually a part of a collection of add-in codes in a file.
| --
|
| Best Regards,
| FARAZ A. QURESHI
|
|
| "FARAZ QURESHI" wrote:
|
| > I need to make a button on a new TOOLBAR for starting a specific macro.
How
| > to do the same?
| >
| > All help shall be appreciated.
| >
| > Thanx in advance.
| >
| > --
| >
| > Best Regards,
| > FARAZ A. QURESHI