Macro-calling shape

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
 
D

Dave Peterson

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

H.G. Lamy

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 & ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top