View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.newusers
Walter Briscoe Walter Briscoe is offline
external usenet poster
 
Posts: 279
Default Record a macro will not edit composite drawing object

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 used this code:
For Each s In ActiveSheet.Shapes
MsgBox s.Name
Next s
and learnt that I have "Group 1", "Picture 27" and "Rectangle 28" to
"Rectangle 37" inclusive.
Looping on MsgBox s.TextFrame.Characters.Text (unsurprisingly) gave me a
type mismatch diagnostic.

I REALLY don't know the VBA debugger. How to I display what is in
ActiveSheet.Shapes("Rectangle 28") from the debugger?

A series of operations like ActiveSheet.Shapes("Rectangle
28").TextFrame.Characters.Text = "28" allowed me to identify those
rectangles and confirmed to me I need to analyse "Group 1". How?

I can have a macro write to any of "Rectangle *".

Right-clicking a rectangle gives me a Grouping control which would allow
me to change the contents of a group, but I see nothing to display a
group.


ActiveSheet.Shapes("shapename").TextFrame.Charact ers.Text = "whatever"

I use this to do a bunch at once.
Sub NameShapes()
Sheets("checks").Select
For Each c In [setup!a4:a15]
ActiveSheet.Shapes(c).TextFrame. _
Characters.Text = c.Offset(0, 1)
Next c
End Sub


--
Walter Briscoe