Macro-calling shape

  • Thread starter Thread starter H.G. Lamy
  • Start date Start date
H

H.G. Lamy

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
 
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 & ...
 
Thank you, Dave

hgl

Dave Peterson said:
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 & ...
 
Back
Top