Group drawing objects in VBA

B

Bubb

Excel 2002. I have some shapes (lines) that I want to group together
using VBA so I can fill the shape that they form.
 
A

Ardus Petus

ActiveSheet.Shapes.Range(Array("Line 3", "Line 4", "Line 1", "Line
2")).Select
Selection.ShapeRange.Group.Select

HTH
 
B

Bubb

Thank you. A problem is that there are many other shapes on the sheet
which I don't want in this group, so I need to collect these names in
an array as they are drawn. Since the Shapes.Range(Array...) wants
string names and I don't know how many there will be, I'm confused
about how to dim the array, redim it when I know how many lines there
will be, and use it to select the group of lines. I'm probably not
doing this the best way. Thanks again.
 
Top