View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Pass Command Button info

The

Application.CommandBars.ActionControl

returns a CommandBarButton object referencing the button that called the
assigned procedure. So if you have several buttons assigned to the same
procedure, this object will tell you what button called it. You can then get
the Caption of the control to see what see it needs to work with.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)'



"J Streger" wrote in message
...
I have a custom menu on my sheet. Each menu option's name contains the name
of the sheet I want to interact with. What I want to do is when the user
clicks the menu item I want to pass either the name of the menu item
clicked
or pass an object referring to the menu button, so I can write one method
rather than 12 to control the menu. is this possible in VBA?

--
*********************
J Streger
MS Office Master 2000 ed.
MS Project White Belt 2003