Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

controlling wordart in excel using VBA

Status
Not open for further replies.

brans

Programmer
Apr 11, 2001
17
US
HELP!

I have to make a circle with a variable number of wordart shapes around it (depending on the user). I need to be able to adjust the spacing and angle of the wordart shapes as well as do a count on the shapes using VBA.

I can change the size and rotation, but only using a static number. I can't figure out how to count the number of shapes.

b = 11.25
For a = 3 To 34

ActiveSheet.Shapes(a).Select
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Rotation = b
b = b + 11.25
Next

Also, is there an easy way to adjust spacing?

Does what I'm asking make any sense?


 
The Shapes collection has a Count property so use:

for a = 0 to ActiveSheet.Shapes.Count-1
.
.
.
next a

To adjust the spacing try the following:

ActiveSheet.Shapes.Range.Distribute(msoDistributeHorizontally, false)

I dont think it is quite what you want as it will evenly distribute the shapes but is the only thing I could find without doing lots of calculations and trigonometry!!

M :)
 
Thanks, that gives me some ideas and definitely helps on the count. Unfortunately we spent most of the morning doing trig calculations UGH! But they seem to be working.

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top