Selecting a Drawing Object

T

Troubled User

I need to get the name of a drawing object when I click it via a left click,
something like:

Sub TheDrawingObject

msgbox(me.name)

End Sub

I need to assign it to a variable. Any help would be greatly appreciated.
 
D

Dave Peterson

Option Explicit
Sub TheDrawingObject()
Dim myShape as shape
set myshape = activesheet.shapes(application.caller)

'just to show a few ways to get it and other options
msgbox application.caller _
& vblf & myshape.name _
& vblf & myshape.topleftcell.address

End sub
 

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