View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_3_] Bob Phillips[_3_] is offline
external usenet poster
 
Posts: 2,420
Default Returning values from OnAction

In the OnACtion macro, you can get immediate access to that control and its
properties via the ActionControl property

Wth Application.Commandbars.ActionControl

MsgBox .Caption

MsgBox .Tag

'etc.
End With

--
__________________________________
HTH

Bob

"Trooper" wrote in message
...
I am using Excel 2003, and Visual Basic for Applications. (I've been using
a
reference book written in 1994, but have looked online and through the VBA
help material extensively.)

I have managed to write code to place a custom menu on the Worksheets Menu
Bar, add two popup controls, "Go To" and "Print", and add the names of the
worksheets of the workbook to each as control buttons. But, I can't
figure
out how to return values from a control. I know I can use OnAction to run
a
procedure, but I want to know, for example, the Caption of the button that
was clicked. (Just getting the index number of the clicked button would
probably help, but then I'd have to figure out how to translate that index
number into the caption. But, I would be happy to know how to get both
the
caption and the index, just for future reference.

Thanks!!!