|
Custom Menu
So much of what I do for my internal customers is repetitive. We quickly realized that if we built them an Excel add-ins toolkit, they could do a lot of the grunt work themselves.The toolkit is constantly evolving and growing. I actually added 2 tools today and fixed a few little bugs.
|
|
Option Explicit
Private Sub Workbook_AddInInstall()
Dim objCmdBrPp As CommandBarPopup
Dim objCmdBtn As CommandBarButton
Dim myCustom As CommandBarControl
Dim cbcMenuBar As CommandBar
Dim iHelpIndex As Integer
Set cbcMenuBar = Application.CommandBars("Worksheet Menu Bar")
iHelpIndex = cbcMenuBar.Controls("Help").Index
Set myCustom = cbcMenuBar.Controls. _
Add(Type:=msoControlPopup, before:=iHelpIndex)
With myCustom
.Caption = "&RGB"
With .Controls.Add(Type:=msoControlButton)
.Caption = "Shor&ten UPC Width"
.OnAction = "FixUPCLength" 'Chg 11 or 12 digit UPC to standard 10
.FaceId = 9678
End With
With .Controls.Add(Type:=msoControlButton)
.Caption = "Pad UPC to 10 digits"
.OnAction = "Text2NumericUPC"
.FaceId = 3096
'Padded to 10 places
End With
With .Controls.Add(Type:=msoControlButton)
.Caption = "B&reak Sheet by Stores"
.OnAction = "BreakStoresIntoTabs"
.BeginGroup = True 'Separtor line above
.FaceId = 2556 'Menu Icon
End With
With .Controls.Add(Type:=msoControlButton)
.Caption = "T&wist Stores from Top"
.OnAction = "TwistAndShout"
.FaceId = 9143
End With
With .Controls.Add(Type:=msoControlButton)
.Caption = "Combine Ta&bs into One Sheet"
.OnAction = "CombineIntoOne"
.FaceId = 1548
End With
With .Controls.Add(Type:=msoControlButton)
.Caption = "Insert Date in Cell"
.OnAction = "PopUpCalendar"
.FaceId = 1106
End With
With .Controls.Add(Type:=msoControlButton)
.Caption = "Help"
.OnAction = "GetVersionInfo"
.FaceId = 1089
.BeginGroup = True
End With
End With
End Sub
Private Sub Workbook_AddinUninstall()
On Error Resume Next
Application.CommandBars("Worksheet Menu Bar") _
.Controls("&RGB").Delete
End Sub
|
The red box in the example is simply hiding the name of the company I wrote this for. None of the other information is confidential. I used one of my tools this morning and it ran so fast that I thought it did not work.
|
©
2005-2024
Updated: | 06/21/2024 07:42 |
This page added: | 26 April 2005 |
|