Dave,
You're a genius. It works. I'll paste the code below that creates the
toolbar in case someone else ever asks you the question. You'll notice
it looks very familiar to your own! I put all of this code in a
workbook and on one of the sheets, I made pictures of all the
characters. Since they are wingding characters, I just typed them all
in paint and copied them as an image into one of the sheets. I just
named them sequentially to index it with the loop.
Best of luck!
Option Explicit
Public Const ToolBarName As String = "T/M 2"
'===========================================
Sub Auto_Open()
Call CreateMenubar
End Sub
'===========================================
Sub Auto_Close()
Call RemoveMenubar
End Sub
'===========================================
Sub RemoveMenubar()
On Error Resume Next
Application.CommandBars(ToolBarName).Delete
On Error GoTo 0
End Sub
'===========================================
Sub CreateMenubar()
Dim iCtr As Long
Dim MacNames As Variant, MacNames2 As Variant
Dim CapNamess As Variant, CapNamess2 As Variant
Call RemoveMenubar
MacNames = Array("TM1", _
"TM2", _
"TM3", _
"TM4", _
"TM5", _
"TM6", _
"TM7", _
"TM8", _
"TM9", _
"TM10")
CapNamess = Array("&Immaterial", _
"Tickmark &2", _
"Tickmark &3", _
"Tickmark &4", _
"Tickmark &5", _
"Tickmark &6", _
"Tickmark &7", _
"Tickmark &8", _
"Tickmark &9", _
"Tickmark 1&0")
MacNames2 = Array("SumOf1", _
"SumOf2", _
"SumOf3", _
"SumOf4", _
"SumOf5", _
"SumOf6", _
"SumOf7", _
"SumOf8", _
"SumOf9", _
"SumOf10")
CapNamess2 = Array("Sum of &1", _
"Sum of &2", _
"Sum of &3", _
"Sum of &4", _
"Sum of &5", _
"Sum of &6", _
"Sum of &7", _
"Sum of &8", _
"Sum of &9", _
"Sum of 1&0")
With Application.CommandBars.Add
.Name = ToolBarName
.Left = 200
.Top = 200
.Protection = msoBarNoProtection
.Visible = True
.Position = msoBarTop
With .Controls.Add(Type:=msoControlPopup, Before:=1)
.Caption = "E&xtra Tickmarks"
For iCtr = LBound(MacNames) To UBound(MacNames)
ThisWorkbook.Worksheets("Ticks").DrawingObjects("Tick "
& (iCtr + 1)).Copy
With .Controls.Add(Type:=msoControlButton)
.OnAction = "'" & ThisWorkbook.Name & "'!" &
MacNames(iCtr)
.Caption = CapNamess(iCtr)
.Style = msoButtonIconAndCaption
.FaceId = 333
.PasteFace
End With
Next iCtr
End With
With .Controls.Add(Type:=msoControlPopup, Before:=2)
.Caption = "&Sum of:"
For iCtr = LBound(MacNames2) To UBound(MacNames2)
ThisWorkbook.Worksheets("Ticks").DrawingObjects("Sum "
& (iCtr + 1)).Copy
With .Controls.Add(Type:=msoControlButton)
.OnAction = "'" & ThisWorkbook.Name & "'!" &
MacNames2(iCtr)
.Caption = CapNamess2(iCtr)
.Style = msoButtonIconAndCaption
.FaceId = 333
.PasteFace
End With
Next iCtr
End With
End With
End Sub