Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tim Tim is offline
external usenet poster
 
Posts: 145
Default Get Name of Macro Initiator - Value of underlaying cell?

Consider naming your shapes with the address of the cell they're supposed to
be over.
Then you can just use:

Msgbox Activesheet.Range(Application.Caller).Value

Tim


"SpaceCamel" wrote in message
...
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,




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
Macro not showing in Tools/Macro/Macros yet show up when I goto VBA editor [email protected] Excel Programming 2 March 30th 07 07:48 PM
Need syntax for RUNning a Word macro with an argument, called from an Excel macro Steve[_84_] Excel Programming 3 July 6th 06 07:42 PM
how to count/sum by function/macro to get the number of record to do copy/paste in macro tango Excel Programming 1 October 15th 04 01:16 PM
Start Macro / Stop Macro / Restart Macro Pete[_13_] Excel Programming 2 November 21st 03 05:04 PM


All times are GMT +1. The time now is 11:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"