Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I am trying to add more toolbar options to my right click options
|
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Rosie
Maybe thiis Or do you want to add buid in controls ? See example below this example This example will add 3 controls to the Cell menu that run your own macro's. Change this two lines : onaction_names = Array("macro1", "macro2", "macro3") caption_names = Array("caption 1", "caption 2", "caption 3") Sub Add_Controls() Dim i As Long Dim onaction_names As Variant Dim caption_names As Variant onaction_names = Array("macro1", "macro2", "macro3") caption_names = Array("caption 1", "caption 2", "caption 3") With Application.CommandBars("Cell") For i = LBound(onaction_names) To UBound(onaction_names) With .Controls.Add(Type:=msoControlButton) .OnAction = ThisWorkbook.Name & "!" & onaction_names(i) .Caption = caption_names(i) End With Next i End With End Sub Sub Delete_Controls() Dim i As Long Dim caption_names As Variant caption_names = Array("caption 1", "caption 2", "caption 3") With Application.CommandBars("Cell") For i = LBound(caption_names) To UBound(caption_names) On Error Resume Next .Controls(caption_names(i)).Delete On Error GoTo 0 Next i End With End Sub This example will add the Save and Print control to the cell menu. Sub Add_Cell_Menu_Items() Dim IDnum As Variant Dim N As Integer IDnum = Array("3", "4") For N = LBound(IDnum) To UBound(IDnum) On Error Resume Next Application.CommandBars("Cell").Controls.Add _ Type:=msoControlButton, ID:=IDnum(N), befo=1 On Error GoTo 0 Next N End Sub Sub Delete_Cell_Menu_Items() Dim IDnum As Variant Dim N As Integer IDnum = Array("3", "4") For N = LBound(IDnum) To UBound(IDnum) On Error Resume Next Application.CommandBars("Cell").FindControl(ID:=ID num(N)).Delete On Error GoTo 0 Next N End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Rosie" wrote in message ... I am trying to add more toolbar options to my right click options |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
right click menu shortcut changed from 2002 to 2003 | Excel Discussion (Misc queries) | |||
Where is the toolbar with the "bold type", "font type", options | New Users to Excel | |||
Spreadsheet shortcuts not working | Setting up and Configuration of Excel | |||
CANT SAVE TOOLBAR CHANGES EXCEL 2003) | Excel Discussion (Misc queries) | |||
How do I set Save Options? | Excel Discussion (Misc queries) |