Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default shape grouping text

You could ungroup them, put in the text, then regroup

Sub A_AssignText()
Dim c1 As Shape
Dim c2 As Shape
Dim grp As Shape
Dim shp As Shape
Dim shp1 As Shape
Dim i as long
Dim arShapes() As Variant
Dim objRange As ShapeRange

Set grp = ActiveSheet.Shapes("group1")
ReDim arShapes(0 To grp.GroupItems.Count - 1)
i = 0
For Each shp In grp.GroupItems
arShapes(i) = shp.Name
i = i + 1
Next
grp.Ungroup
Set objRange = ActiveSheet.Shapes.Range(arShapes)
Set c1 = ActiveSheet.Shapes("Circ1")
Set c2 = ActiveSheet.Shapes("Circ2")
c1.TextFrame.Characters.Text = "c1"
c2.TextFrame.Characters.Text = "c2"
Set shp1 = objRange.Group
shp1.Name = "group1"
End Sub

Tested in xl2000, SR1

Regards,
Tom Ogilvy

"msnews.microsoft.com" wrote in message
...
I'm trying to design a shape thats basicly a rectangle with two inneer
circles. Basicly I need to be able to asign from code text to each of the
inner circles.

I've tried the following but dosen't work:
Dim c1 As Shape
Dim c2 As Shape
Dim grp As Shape

Set grp = Sheet1.Shapes("group1")
Set c1 = grp.GroupItems("circ1")
Set c2 = grp.GroupItems("circ2")

c1.TextFrame.Characters.Text = "c1"
c2.TextFrame.Characters.Text = "c2"

Two problems 1) aperently groupitems(name) cant find the circles, works

fine
with index. 2) textframe.characters.text dose not work when items are
grouped.

Is this the way it works, or am I missing something?





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
How to set default shape format for a text box Simon Reid[_2_] Excel Discussion (Misc queries) 0 December 10th 09 06:04 PM
my curser changed from arrow shape to a cross shape???? bj New Users to Excel 1 February 5th 07 02:47 PM
Change Shape Text rhani111 Excel Worksheet Functions 2 July 14th 06 02:31 PM
Shape colour set according to text value tonywig Excel Discussion (Misc queries) 1 April 19th 06 07:18 PM
Copying text from a shape rj Excel Discussion (Misc queries) 4 March 10th 06 02:41 PM


All times are GMT +1. The time now is 12:11 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"