Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Identify shape clicked within a group 2

Status
Not open for further replies.

FractalWalk

Technical User
Nov 18, 2002
141
US
I am using Excel 2002 and am creating an interactive map using shapes. I have grouped multiple shapes together and I have assigned a macro to fire when the group is clicked.

I need to be able to identify the individual shape within the group that was clicked. For example, if the group is a map of the United States with a collection of individual state shapes, I want to identify the individual state that the mouse is over when the map is clicked.

I believe this is possible as when I click on the group the individual shape appears to be highlighted, but I can't seem to find the right code to identify that highlighted shape.
 
Perhaps the Application.Caller property may be of interest ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Awesome! shp = Application.Caller worked just fine.

On a related issue. These shapes are "freeform" shapes and I want to have text added. I see text options for most shapes but not freeform. I tried to assign text to it, but got an object does not support property error.

Is there any way to attach text without creating another object (e.g. textbox, rectangle etc.)
 
On a related issue. These shapes are "freeform" shapes and I want to have text added. I see text options for most shapes but not freeform. I tried to assign text to it, but got an object does not support property error.

Is there any way to attach text without creating another object (e.g. textbox, rectangle etc.)
Hi FractalWalk:

Here is a workaround ... I entered needed text in a cell. I copied the cell and Pasted Picture Link to that in another cell and then dragged it onto the FreeForm Shape (Order Bring to Front). If I needed to edit the text, I edited it in the original cell and it got updated in the FreeForm shape as well.

Depending on your project constraints and/or personal preference, this workaround may or may nor work for you.

Yogi Anand, D.Eng, P.E.
Energy Efficient Building Network LLC
 
Thanks!!

That works perfectly and it also solves another problem I had in easily linking dynamic data to the text.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top