How do I select all shapes (array? range?) where the value in Cell "A:Shape.TopLeftCell.Row" = 0
?
The Array should consist only Shapes 2 and 3 as per image above.
How do I select all shapes (array? range?) where the value in Cell "A:Shape.TopLeftCell.Row" = 0
?
The Array should consist only Shapes 2 and 3 as per image above.
Build a ShapeRange that meets the criteria and then Select that ShapeRange
There is another way around of this. I came across this post while looking for a solution.
So here it is the Answer for anyone looking for a way around.
The Method goes like this:
Run a
loop
like this once to change the names of theRectangles
to the Address of theirTopLeftCell
Now in any other code you can directly access the shape using:
This is one way you can achieve it. Though there doesn't exist a method that you are looking for.
You can change the
ActiveCell.Address
any range object or maybe just the text itself. It will take values like$D$4
Tried and Tested, it works Smoothly.
Just as an alternative, you can reverse the logic and select as you go, then assign the selection to a shaperange if required:
You can loop through the shapes on the sheet until you find one in the range. As someone else mentioned, selecting is often unnecessary.