ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Selecting shapes (https://www.excelbanter.com/excel-discussion-misc-queries/145228-selecting-shapes.html)

Daniel Bonallack

Selecting shapes
 
I want a macro that will group every drawing object on the page (and it will
be a different number each time).

So I recorded a macro by selecting two rectangles...
ActiveSheet.Shapes.Range(Array("MyRect97", "MyRect96")).Select

Then I attempted to build the array set differently, but it didn't work
myShape = "MyRect97" & """" & "," & """" & "MyRect96"
ActiveSheet.Shapes.Range(Array(myShape)).Select

Can you tell me how I to populate the variable "myShape" correctly?
Thanks in advance.

Daniel



Bob Umlas

Selecting shapes
 
activesheet.drawingobjects.group
or
activesheet.drawingobjects.Select

"Daniel Bonallack" wrote in
message ...
I want a macro that will group every drawing object on the page (and it
will
be a different number each time).

So I recorded a macro by selecting two rectangles...
ActiveSheet.Shapes.Range(Array("MyRect97", "MyRect96")).Select

Then I attempted to build the array set differently, but it didn't work
myShape = "MyRect97" & """" & "," & """" & "MyRect96"
ActiveSheet.Shapes.Range(Array(myShape)).Select

Can you tell me how I to populate the variable "myShape" correctly?
Thanks in advance.

Daniel






All times are GMT +1. The time now is 10:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com