Customer menu Item

T

Todd Huttenstine

Is it possible instead of assigning a macro to a menu item that I can make
it run a code associated directly with the button click instead of in a
module?


Thanx
Todd
 
D

Doug Glancy

Todd,

Buttons on a commandbar do not have a click event. Is that what you are
asking? What are you trying to do?

Doug Glancy
 
D

David Adamson

I think I know what you are after.

If you want to assign a macro to a menu item that you already have created
and linked to a button on a worksheet or form.

To activate a macro from another macro its

Call MacroName

This is what I use for a toolbar button so the code should be something
simualr for a custom menu (Original code came from John Green)

With MD_Control.Controls(1)
'call the macro you want to execute
.OnAction = "MacroName"
'the faceID = button
.FaceId = 65
'Tooltip = label you see when the mouse pointer is over the button
.TooltipText = "Run the Macro"
End With


Sub MacroName
'your caode here
End Sub
 
T

Todd Huttenstine

Yes I want to make a menu item (or button) have its own independant code it
runs) instead of referencing code in another module.

I am trying to come up with an alternate solution of replacing all
components in a workbook that is already open.
 
Top