Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Grouping Shapes


Hi,

Just can't figure how to group shapes of a sheet..


something like:

For i = 1 To ActiveSheet.Shapes.Count

If Left(ActiveSheet.Shapes(i).Name, 6) = "Forme " Then AddtoGroup

Next i

I can do this:

ActiveSheet.Shapes.Range(Array("Shape1", "Shape2")).Select
Selection.ShapeRange.Group.Selec

But the "Array" part in my case is variable and I can't find how to pu
a variable instead of Array("Shape1", "Shape2")).

Thank

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default Grouping Shapes

Hi Mat

Here's one way to do it:

Sub MakeShapeRange()
'Leo Heuser, 20 Nov. 2003
Dim Counter As Long
Dim NumShapes As Long
Dim NumShapesToUse As Long
Dim SelectShapes As ShapeRange
Dim ShapeName() As Variant

NumShapesToUse = 0

With ActiveSheet
NumShapes = .Shapes.Count

For Counter = 1 To NumShapes
If Left(.Shapes(Counter).Name, 6) = "Forme " Then
NumShapesToUse = NumShapesToUse + 1
ReDim Preserve ShapeName(1 To NumShapesToUse)
ShapeName(NumShapesToUse) = .Shapes(Counter).Name
End If
Next Counter

Set SelectShapes = .Shapes.Range(ShapeName)
SelectShapes.Select
End With

End Sub


--
Best Regards
Leo Heuser

Followup to newsgroup only please.

"MatP" skrev i en meddelelse
...

Hi,

Just can't figure how to group shapes of a sheet..


something like:

For i = 1 To ActiveSheet.Shapes.Count

If Left(ActiveSheet.Shapes(i).Name, 6) = "Forme " Then AddtoGroup

Next i

I can do this:

ActiveSheet.Shapes.Range(Array("Shape1", "Shape2")).Select
Selection.ShapeRange.Group.Selec

But the "Array" part in my case is variable and I can't find how to put
a variable instead of Array("Shape1", "Shape2")).

Thanks


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel document with shapes on it but the shapes do not print [email protected] Excel Worksheet Functions 2 October 22nd 09 06:17 PM
Naming Auto Shapes and Creating new Shapes AL2000 Excel Discussion (Misc queries) 3 September 10th 07 04:12 AM
When drawing shapes in excel the shapes keep disappearing Tape Excel Discussion (Misc queries) 1 October 6th 06 04:23 PM
How can i get more 3D shapes for Auto shapes in excel? Ajey Excel Discussion (Misc queries) 0 March 3rd 05 09:53 AM
How can i get more 3D shapes for Auto shapes in excel? Ajey Excel Discussion (Misc queries) 0 March 3rd 05 09:53 AM


All times are GMT +1. The time now is 11:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"