SHK
SHK

Reputation:

Finding Cell Range With Excel Macros

I have an many embedded objects (shapes) in a worksheet and the icons is displayed inside a cell. How do I know the Cell range in which the shape object is displayed.

Example: When I select a B2 and then select the object(shape) in the B17, and I query on the Cell.Address it shows B2 - how do I get the cell address as B17?

thanks

Upvotes: 0

Views: 601

Answers (1)

Hobbo
Hobbo

Reputation: 612

You can use the Shape properties .TopLeftCell and .BottomRightCell to return the extents of the rectangular range that the shape overlaps.

In your example, YourShape.TopLeftCell.Address should return $B$17

Upvotes: 4

Related Questions