Returning Image Details

G

Guest

I have a procedure that inserts various images onto a spreadsheet.

I want to be able to select an image (by clicking or maybe right clicking or
double clicking) and have a procedure to return the name of the image object.

For example, if i click on a particular image that was named "Image_A" when
it was inserted, I would like the macro to return "Image_A".

I tried assigning a macro to the images as they were inserted (using
..onaction) but I don't know how to get that macro to return the name of the
object that set it running.

Hope this makes sense, Kaval
 
P

Peter T

Try this -

Sub myOnActionMacro()
Dim sCaller As String

sCaller = Application.Caller

MsgBox sCaller

End Sub

You can assign the same macro to all all your images and perhaps use "Select
Case sCaller" to branch.

Regards,
Peter T
 

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