Reputation: 1293
I am trying to create an excel template where I have already assigned different macros to different shape that act as buttons. Now I am having problem of locating which one I have clicked since I need to modify the attributes of the clicked shape after clicking on that shape. While searching on this problem, I have noticed that there is a way to identify which shape has been selected whereas I still doesn't know How to get the name of the shape I have clicked or is there a way to refer to that clicked shape in VBA? Thank you!
Upvotes: 9
Views: 68555
Reputation: 7303
You should be able to get the name of the clicked shape by using Application.Caller
usage as shown
CallingShapeName = ActiveSheet.Shapes(Application.Caller).Name
msgbox CallingShapeName
Upvotes: 20
Reputation: 21
ActiveSheet.Shapes(Application.Caller).TextFrame.Characters.Text
Upvotes: 2