View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.newusers
diglas1 via OfficeKB.com
 
Posts: n/a
Default Can I select and Group Autoshapes in Excel 97 ?

David(,Don and Debra),
Apologies if my replies have been to the wrong threads, but the names
addressed to each are correct. This is my first forray into this site, in
fact any help site and I now see how the threads stretch down the LHS....
however, I think I replied to the correct response buttons.
Anyway, thank you all for your kind suggestions, I trawled the net for days
and tries various books to no avail, unable to find answers...I've gratefully
learned a great deal.

David specifically, thanks, I see that your excellent Shapes page also had
Debra's answer.

For the sake of future browsers of these answers, I was still unable to get
the shapes to "Group" in VBA, which was my original problem, but having
found the user interface answer from D&D, just ran it as a macro to get the
code, which is:

ActiveSheet.DrawingObjects.Select
Selection.ShapeRange.Group.Select

Thanks all of you again.


David McRitchie wrote:
Hi Diglas (and Debra),
Nice to know about the multiple objects.

But I think Diglas is not seeing the threading properly, and
so I'm not sure if he was actually replying to Don or to me.

But from the answers I get the impression he did not find
what I was looking at when I referred him to my shapes page
so I will provide a more specific example below and to my
htm page and to the code page.

Sub delAllRectangularShapesOnSht()
Dim shp As Shape
For Each shp In ActiveWorkbook.ActiveSheet.Shapes
'check shape code for Particular Shapes:
If shp.AutoShapeType = msoShapeRectangle Then shp.Delete
Next shp
End Sub

Right at the top of the Shapes page:
http://www.mvps.org/dmcritchie/excel/shapes.htm
is a reference to the code in
http://www.mvps.org/dmcritchie/excel/code/shapes.txt

within the shapes.txt file are two subroutines one will remove all
rectangular shapes that have their upper left corner in the
cell selection area. I've added the example above to both
the shapes.htm page and the code/shapes.txt file.

One of the reasons for having a text version of the code is to
be able to have more complete subroutines, a few additional
subroutines, and to make sure that HTML is not going to interfere
with copying code. Especially for such things as greater than,
and less than signs, and the use of ampersands.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

To select all the objects on the sheet --
Choose EditGo To, click Special

[quoted text clipped - 28 lines]
Any suggestions welcome
Thanks in anticipation.


--
Message posted via http://www.officekb.com