select shape range

  • Thread starter Thread starter Monte0682
  • Start date Start date
M

Monte0682

Hello

I have an array that contains names of 10 shapes in excell sheet. Now
I would like to make a function that will select all the shapes from
the array and group them. I was thinking of somthing like this...but
it doesn't work.

ActiveSheet.shapes.Range(array_shapes()).Select

where I did:

Public array_shapes as shapes

What I am doing wrong?
 
AA and AC work for me. AB does not.

Sub AA()
Dim v1(0 To 1) As Variant
v1(0) = "Oval 1"
v1(1) = "Rectangle 5"
ActiveSheet.Shapes.Range(v1).Select

End Sub
Sub AB()
Dim v As Variant
v = Array("Oval 1", "Rectangle 5")
ActiveSheet.Shapes.Range(v).Select
End Sub

Sub AC()
ActiveSheet.Shapes.Range(Array( _
"Oval 1", "Rectangle 5")).Select

End Sub
 
I have an array that contains names of 10 shapes in excell sheet. Now
I would like to make a function that will select all the shapes from
the array and group them. I was thinking of somthing like this...but
it doesn't work.
Did you try to start the macro recorder, do the selection/grouping manually,
and to see what code it generates?

FM
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top