Get Name of Macro Initiator - Value of underlaying cell?
Just what I was looking For.
Thanks guys.
'--------------------------
One more thing...
I now need to get the value of the cell that the shape is over.
-----
The shapes were added with this code to put them over the correct cell.
With thiscell
With .Parent.Shapes.AddShape( _
Type:=msoShapeRoundedRectangle, _
Left:=.Left + 2, _
Top:=.Top, _
======================================
"Tom Ogilvy" wrote:
Assume you mean buttons from forms toolbar.
Sub Button_click()
Dim sName as String, btn as Button
sname = Application.Caller
set btn = Activesheet.Buttons(sname)
msgbox btn.Caption
End Sub
If you mean a picture that looks like a button, the approach would be
similar but you couldn't use the buttons collection
--
Regards,
Tom Ogilvy
"SpaceCamel" wrote:
I have many graphical buttons on a sheet with different names/properties but
all initiate the same macro. I need the macro to get the name/properties of
the initiating button.
Is there a "who started me" value I can get?
Thanks,
|