Attaching a macro (module) code to button

  • Thread starter Thread starter Todd Huttenstine
  • Start date Start date
T

Todd Huttenstine

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, Before:=11
 
You're looking for the OnAction property.

You can do a help search for commandbar.
 
Back
Top