Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Macro-calling shape

Hello,

can the actual macro-calling shape be identified when there are 2 shapes
assigned to the same VBA-procedure ?

Thank you in advance.

Regards,

hglamy



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Macro-calling shape

Try:

msgbox application.caller

You'll see the name of the shape that's calling the macro...

You can use:

dim myShape as shape
set myshape = activesheet.shapes(application.caller)

then use all the properties for that shape

msgbox myshape.name & vblf & myshape.topleftcell.address & ...

"H.G. Lamy" wrote:

Hello,

can the actual macro-calling shape be identified when there are 2 shapes
assigned to the same VBA-procedure ?

Thank you in advance.

Regards,

hglamy


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Macro-calling shape

Sub dural()
MsgBox Application.Caller
End Sub

--
Gary''s Student - gsnu201001


"H.G. Lamy" wrote:

Hello,

can the actual macro-calling shape be identified when there are 2 shapes
assigned to the same VBA-procedure ?

Thank you in advance.

Regards,

hglamy



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Macro-calling shape

Thank you, Dave

hgl

"Dave Peterson" wrote in message
...
Try:

msgbox application.caller

You'll see the name of the shape that's calling the macro...

You can use:

dim myShape as shape
set myshape = activesheet.shapes(application.caller)

then use all the properties for that shape

msgbox myshape.name & vblf & myshape.topleftcell.address & ...

"H.G. Lamy" wrote:

Hello,

can the actual macro-calling shape be identified when there are 2 shapes
assigned to the same VBA-procedure ?

Thank you in advance.

Regards,

hglamy


--

Dave Peterson



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
Which Shape Ran The Macro? [email protected] Excel Programming 5 August 3rd 07 05:25 PM
my curser changed from arrow shape to a cross shape???? bj New Users to Excel 1 February 5th 07 02:47 PM
Assigning Macro To Shape Tommi[_2_] Excel Programming 2 October 31st 03 10:58 AM
Deleting a shape and the cell contents the shape is in. Dave Peterson[_3_] Excel Programming 1 October 9th 03 03:36 PM
Deleting a shape and the cell contents the shape is in. Tom Ogilvy Excel Programming 0 October 9th 03 03:43 AM


All times are GMT +1. The time now is 03:26 AM.

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"