View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.newusers
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Record a macro will not edit composite drawing object

Does this help?
Sub listem()
On Error Resume Next
i = 1
For Each sh In Sheets("CHECKS").Shapes
'MsgBox sh.Name
Cells(i, 1) = sh.Name
i = i + 1
Next
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Walter Briscoe" wrote in message
...
In message of Thu, 8 Jan 2009
17:29:05 in microsoft.public.excel.newusers, Walter Briscoe
writes
In message of Wed, 7 Jan 2009
18:30:44 in microsoft.public.excel.newusers, Don Guillett
writes

Thank you! How do I tell which shapes exist and their names?


I got no reply, but soldiered on. I now have something like:
' Grab "Group 1" and split it into components
ActiveSheet.Shapes(1).Select
Selection.ShapeRange.Ungroup.Select
' Write 12345 in Arial, Bold, right-justified into Rectangle 6
ActiveSheet.Shapes("Rectangle 6").Select
Selection.Characters.Text = "12345"
With Selection.Characters(Start:=1, Length:=5).Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 14
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Selection.HorizontalAlignment = xlRight
' Form a new group
ActiveSheet.Shapes.Range(Array("Rectangle 2", "Rectangle 3" _
, "Rectangle 4", "Rectangle 5" _
, "Rectangle 6", "Rectangle 7", "Rectangle 8", "Rectangle 9" _
, "Rectangle 10", "Rectangle 11", "Rectangle 12", "Rectangle 13" _
, "Rectangle 14", "Rectangle 15", "Rectangle 16", "Rectangle 17" _
, "Rectangle 18", "Rectangle 19", "Rectangle 20", "Rectangle 21" _
, "Rectangle 22", "Rectangle 23", "Rectangle 24", "Rectangle 25" _
, "Text Box 26")).Select
Selection.ShapeRange.Regroup.Select

This does what I want but replaces "Group 1" with "Group 38".
It also requires me to know how "Group 1" is composed.
There must be a better way!

(I have enabled the Draw Toolbar and ensured the Select Multiple Objects
button is enabled in it.)
--
Walter Briscoe