AD_Taylor
Well-known Member
- Joined
- May 19, 2011
- Messages
- 687
Hi guys,
At the moment I have this code:
Is it possible to change this code so that it can add an icon next to the caption Distribute Columns?
This is with Excel 2007 - 2010 so the Add-Ins appear in their own portion of the Ribbon.
Also if it helps the macro ReSizeCols is a very simple macro that checks a selection made by the user, and makes all columns as wide as the largest one in that selection.
Thanks for any help,
Adam
At the moment I have this code:
Code:
Private Sub Workbook_AddinInstall()
On Error Resume Next 'Just in case
'Delete any existing menu item that may have been left.
Dim CaptionName As String
CaptionName = "Distribute Columns"
Application.CommandBars("Worksheet Menu Bar").Controls(CaptionName).Delete
'Add the new menu item and Set a CommandBarButton Variable to it
Set cControl = Application.CommandBars("Worksheet Menu Bar").Controls.Add
'Work with the Variable
With cControl
.Caption = CaptionName
.Style = msoButtonCaption
.OnAction = "ReSizeCols"
'Macro stored in a Standard Module
End With
End Sub
Is it possible to change this code so that it can add an icon next to the caption Distribute Columns?
This is with Excel 2007 - 2010 so the Add-Ins appear in their own portion of the Ribbon.
Also if it helps the macro ReSizeCols is a very simple macro that checks a selection made by the user, and makes all columns as wide as the largest one in that selection.
Thanks for any help,
Adam