Link to home
Start Free TrialLog in
Avatar of hindersaliva
hindersalivaFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Excel 2013 VBA - select multiple shapes

I have a number of small rectangles on a sheet. I can iterate through the shapes that are positioned within a selected cell range ok.

My problem is this. For example, I know the syntax looks like
Sheet1.Shapes.Range(Array("Rectangle 1", "Rectangle 2", "Rectangle 3")).Select

I need to be able to construct a string "Rectangle 1", "Rectangle 2", "Rectangle 3" programmatically, right? But when I do I get an extra set of " that I cannot get rid of, and I get an error saying "selected item not found".
(I should clarify, the shapes will have different names. ie. not always the same. Hence programmatically)

So, how can I select multiple shapes please?
Thanks
Avatar of ThomasMcA2
ThomasMcA2

Please post your code.
ASKER CERTIFIED SOLUTION
Avatar of ltlbearand3
ltlbearand3
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hindersaliva

ASKER

Thanks. I didn't know I can use an Array of shape names. It made it a lot simpler!!!!!