Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
I have the following code which adds the macros to the cell menu. How do I
begin a group for the array or assign the array to a submenu. TIA Greg |
#2
![]() |
|||
|
|||
![]()
Might be nice if I added the code:
Sub AddtoCellMenuAbs() Dim iCtr As Long Dim myMacros As Variant Dim myCaptions As Variant Dim cb As CommandBar Set cb = Application.CommandBars("Cell") myMacros = Array("Absolute.Absolute", "Relative", "AbsoluteRow", "AbsoluteCol") myCaptions = Array("Absolute", "Relative", "Absolute Row", "Absolute Col") With cb.Controls For iCtr = LBound(myMacros) To UBound(myMacros) With .Add(Type:=msoControlButton, temporary:=True) .Caption = myCaptions(iCtr) .OnAction = ThisWorkbook.Name & "!" & myMacros(iCtr) ' .FaceId = 103 ' .BeginGroup = True End With Next iCtr End With 'in your workbook_open/auto_open code, you can just have a 'Call AddToCellMenu End Sub Greg "GregR" wrote in message ... I have the following code which adds the macros to the cell menu. How do I begin a group for the array or assign the array to a submenu. TIA Greg |
#3
![]() |
|||
|
|||
![]()
Hi GregR,
One way: Sub AddtoCellMenuAbs() Dim iCtr As Long Dim myMacros As Variant Dim myCaptions As Variant Dim blBeginGroup As Boolean Dim cb As CommandBar Set cb = Application.CommandBars("Cell") myMacros = Array("Absolute.Absolute", "Relative", _ "AbsoluteRow", "AbsoluteCol") myCaptions = Array("Absolute", "Relative", _ "Absolute Row", "AbsoluteCol ") With cb.Controls For iCtr = LBound(myMacros) To UBound(myMacros) With .Add(Type:=msoControlButton, temporary:=True) .Caption = myCaptions(iCtr) .OnAction = ThisWorkbook.Name & "!" & myMacros(iCtr) .FaceId = 103 If Not blBeginGroup Then .BeginGroup = True blBeginGroup = True End If End With Next iCtr End With 'in your workbook_open/auto_open code, you can just have a 'Call AddToCellMenu End Sub --- Regards, Norman "GregR" wrote in message ... Might be nice if I added the code: Sub AddtoCellMenuAbs() Dim iCtr As Long Dim myMacros As Variant Dim myCaptions As Variant Dim cb As CommandBar Set cb = Application.CommandBars("Cell") myMacros = Array("Absolute.Absolute", "Relative", "AbsoluteRow", "AbsoluteCol") myCaptions = Array("Absolute", "Relative", "Absolute Row", "Absolute Col") With cb.Controls For iCtr = LBound(myMacros) To UBound(myMacros) With .Add(Type:=msoControlButton, temporary:=True) .Caption = myCaptions(iCtr) .OnAction = ThisWorkbook.Name & "!" & myMacros(iCtr) ' .FaceId = 103 ' .BeginGroup = True End With Next iCtr End With 'in your workbook_open/auto_open code, you can just have a 'Call AddToCellMenu End Sub Greg "GregR" wrote in message ... I have the following code which adds the macros to the cell menu. How do I begin a group for the array or assign the array to a submenu. TIA Greg |
#4
![]() |
|||
|
|||
![]()
Norman, thank you very much.
Greg "Norman Jones" wrote in message ... Hi GregR, One way: Sub AddtoCellMenuAbs() Dim iCtr As Long Dim myMacros As Variant Dim myCaptions As Variant Dim blBeginGroup As Boolean Dim cb As CommandBar Set cb = Application.CommandBars("Cell") myMacros = Array("Absolute.Absolute", "Relative", _ "AbsoluteRow", "AbsoluteCol") myCaptions = Array("Absolute", "Relative", _ "Absolute Row", "AbsoluteCol ") With cb.Controls For iCtr = LBound(myMacros) To UBound(myMacros) With .Add(Type:=msoControlButton, temporary:=True) .Caption = myCaptions(iCtr) .OnAction = ThisWorkbook.Name & "!" & myMacros(iCtr) .FaceId = 103 If Not blBeginGroup Then .BeginGroup = True blBeginGroup = True End If End With Next iCtr End With 'in your workbook_open/auto_open code, you can just have a 'Call AddToCellMenu End Sub --- Regards, Norman "GregR" wrote in message ... Might be nice if I added the code: Sub AddtoCellMenuAbs() Dim iCtr As Long Dim myMacros As Variant Dim myCaptions As Variant Dim cb As CommandBar Set cb = Application.CommandBars("Cell") myMacros = Array("Absolute.Absolute", "Relative", "AbsoluteRow", "AbsoluteCol") myCaptions = Array("Absolute", "Relative", "Absolute Row", "Absolute Col") With cb.Controls For iCtr = LBound(myMacros) To UBound(myMacros) With .Add(Type:=msoControlButton, temporary:=True) .Caption = myCaptions(iCtr) .OnAction = ThisWorkbook.Name & "!" & myMacros(iCtr) ' .FaceId = 103 ' .BeginGroup = True End With Next iCtr End With 'in your workbook_open/auto_open code, you can just have a 'Call AddToCellMenu End Sub Greg "GregR" wrote in message ... I have the following code which adds the macros to the cell menu. How do I begin a group for the array or assign the array to a submenu. TIA Greg |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Maintaining cell reference after sorting | Excel Discussion (Misc queries) | |||
Menu items added with menu item editor in older versions | Excel Discussion (Misc queries) | |||
Delete Cell Value Based on Another Cell T or F | Excel Discussion (Misc queries) | |||
How do I link many cells to one particular cell? | Excel Discussion (Misc queries) | |||
Display actual contents of cell | Excel Discussion (Misc queries) |