ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Attaching a macro (module) code to button (https://www.excelbanter.com/excel-programming/286369-attaching-macro-module-code-button.html)

Todd Huttenstine[_2_]

Attaching a macro (module) code to button
 
Below is a code that creates a button on the Worksheet
menu bar. But how do I programmatically assign
module "createbutton" to it?

Also where can I find more info about programmaticaly
creating buttons on Excel Toolbars?

Thanx
Todd Huttenstine

Application.CommandBars("Worksheet Menu Bar").Controls.Add
Type:= _
msoControlButton, ID:=2950, Befo=11

Rob van Gelder[_4_]

Attaching a macro (module) code to button
 
You're looking for the OnAction property.

You can do a help search for commandbar.


"Todd Huttenstine" wrote in message
...
Below is a code that creates a button on the Worksheet
menu bar. But how do I programmatically assign
module "createbutton" to it?

Also where can I find more info about programmaticaly
creating buttons on Excel Toolbars?

Thanx
Todd Huttenstine

Application.CommandBars("Worksheet Menu Bar").Controls.Add
Type:= _
msoControlButton, ID:=2950, Befo=11





All times are GMT +1. The time now is 11:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com