Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Names of macros for toolbar buttons
Where can I find the names of the macros for the buttons on the standar
or any other toolbar? I have written a macro which I would like t assign to the 'Copy' button but I would like to be able to reverse i if I run into problems -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Names of macros for toolbar buttons
These are built-in controls. They do not have VBA macros
assigned to them but instead have built-in functionality. Excel supports assigning VBA macros to these controls in the normal manner. To reverse this you can "Reset" either the specific control or the entire tool bar. To reset, for example, the Standard tool bar: 1) Right click the tool bar 2) Select Customize (bottom of list) 3) Select the Toolbars tab 4) Select the Standard tool bar from the list 5) Click the Reset button Alternatvely, run the code: Application.CommandBars("Standard").Reset To reset a specific control, for example, the Copy control on the Standard tool bar, run this code: With Application.CommandBars("Standard") .Controls("&Copy").Reset End With Regards, Greg -----Original Message----- Where can I find the names of the macros for the buttons on the standard or any other toolbar? I have written a macro which I would like to assign to the 'Copy' button but I would like to be able to reverse it if I run into problems. --- Message posted from http://www.ExcelForum.com/ . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Names of macros for toolbar buttons
To those reading my post through DevDex, the website
automatically substituted the copyright symbol for the name of the Copy control. It should read as the ampersand symbol "&" immediately preceding the word "Copy". If I join the two the website apparently will make the substitution. Regards, Greg -----Original Message----- These are built-in controls. They do not have VBA macros assigned to them but instead have built-in functionality. Excel supports assigning VBA macros to these controls in the normal manner. To reverse this you can "Reset" either the specific control or the entire tool bar. To reset, for example, the Standard tool bar: 1) Right click the tool bar 2) Select Customize (bottom of list) 3) Select the Toolbars tab 4) Select the Standard tool bar from the list 5) Click the Reset button Alternatvely, run the code: Application.CommandBars("Standard").Reset To reset a specific control, for example, the Copy control on the Standard tool bar, run this code: With Application.CommandBars("Standard") .Controls("&Copy").Reset End With Regards, Greg -----Original Message----- Where can I find the names of the macros for the buttons on the standard or any other toolbar? I have written a macro which I would like to assign to the 'Copy' button but I would like to be able to reverse it if I run into problems. --- Message posted from http://www.ExcelForum.com/ . . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Names of macros for toolbar buttons
You can easily re-direct a built-in toolbar button to your own macro (though
I have to wonder why you would when you could add a new one of your own), but this is how you do it. This is re-directing the Decrease Indent button to one of my macros With Application.CommandBars("Formatting") With .Controls("Decrease Indent") .OnAction = "myTest" End With End With To re-set it, just use With Application.CommandBars("Formatting") With .Controls("Decrease Indent") .OnAction = "" End With End With The names to use can usually be found by hovering over the button and getting the tooltip, but this code will also get them all Dim i With Application.CommandBars("Formatting") For i = 1 To .Controls.Count Debug.Print .Controls(i).Caption Next i End With -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "DredanZyl " wrote in message ... Where can I find the names of the macros for the buttons on the standard or any other toolbar? I have written a macro which I would like to assign to the 'Copy' button but I would like to be able to reverse it if I run into problems. --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Assigning Macros to Toolbar buttons | Excel Discussion (Misc queries) | |||
How can you replicate macros for buttons on the Standard toolbar? | Excel Discussion (Misc queries) | |||
custom toolbar buttons are saved where? Excel loads twice bymistake and all my custom toolbar buttons get gone!!! | Excel Programming | |||
Icons on toolbar buttons (Was: Toolbars with macros) | Excel Programming | |||
Problem with macros assigned to toolbar buttons | Excel Programming |