Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default fonts names in loops

I want to use a loop with wordart and I want to change the font name on each
loop. If the font names have number equivalents I can do it easily.
However, I can't find any place that shows that font names have numbe
equivalents. Anyone have a suggestion.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default fonts names in loops

Disregard this posting. Here is how I solved the problem.

[Sub WATest()
fnt1 = "Arial"
fnt2 = "Kristen ITC"
fnt3 = "Algerian"
Counter = 1
Do
Set myDocument = Worksheets(2)
Set newWordArt = myDocument.Shapes.AddTextEffect
_(PresetTextEffect:=msoTextEffect + Counter, Text:="Watch This",
FontName:=fnt_ & Counter, FontSize:=(Counter * 2) + 40, FontBold:=False,
FontItalic:=False, _ Left:=300, Top:=150)
WaitTime
newWordArt.TextEffect.RotatedChars = msoTrue
WaitTime
newWordArt.TextEffect.ToggleVerticalText
WaitTime
newWordArt.TextEffect.RotatedChars = msoTrue
WaitTime
newWordArt.TextEffect.ToggleVerticalText
WaitTime
newWordArt.Flip msoFlipVertical
WaitTime
newWordArt.Flip msoFlipHorizontal
WaitTime
Worksheets(2).Shapes(1).Delete
WaitTime
Counter = Counter + 1
Loop Until Counter = 4
End Sub]

By using the [ fnt " &" or "+" counter] it will change font name for the
three named at the beginning of the sub.

"JLGWhiz" wrote:

I want to use a loop with wordart and I want to change the font name on each
loop. If the font names have number equivalents I can do it easily.
However, I can't find any place that shows that font names have numbe
equivalents. Anyone have a suggestion.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default fonts names in loops

Even though you have a solution, you may want to look at the way John Walkenbach
gets font names:

http://www.j-walk.com/ss/excel/tips/tip79.htm



JLGWhiz wrote:

I want to use a loop with wordart and I want to change the font name on each
loop. If the font names have number equivalents I can do it easily.
However, I can't find any place that shows that font names have numbe
equivalents. Anyone have a suggestion.


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default fonts names in loops

Thanks Dave, I did not have the solution. I jumped the gun on that one. It
does not work like I thought. I guess I was too tired when I tested it and
thought I saw something that was not there. I'll check out the URL you
listed. Thanks again.

"Dave Peterson" wrote:

Even though you have a solution, you may want to look at the way John Walkenbach
gets font names:

http://www.j-walk.com/ss/excel/tips/tip79.htm



JLGWhiz wrote:

I want to use a loop with wordart and I want to change the font name on each
loop. If the font names have number equivalents I can do it easily.
However, I can't find any place that shows that font names have numbe
equivalents. Anyone have a suggestion.


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default fonts names in loops

OK, Now I have it so it works. Here is the code:

Sub WATest()
Dim fnt(3) As Variant
fnt(1) = "Comic Sans MS"
fnt(2) = "Impact"
fnt(3) = "Algerian"
Counter = 1
Do
Set myDocument = Worksheets(2)
Set newWordArt =
myDocument.Shapes.AddTextEffect(PresetTextEffect:= msoTextEffect + (Counter +
2), Text:="Watch This", FontName:=fnt(Counter), FontSize:=(Counter * 2) + 40,
FontBold:=False, FontItalic:=False, Left:=300, Top:=150)
WaitTime
newWordArt.TextEffect.RotatedChars = msoTrue
WaitTime
newWordArt.TextEffect.ToggleVerticalText
WaitTime
newWordArt.TextEffect.RotatedChars = msoTrue
WaitTime
newWordArt.TextEffect.ToggleVerticalText
WaitTime
newWordArt.Flip msoFlipVertical
WaitTime
newWordArt.Flip msoFlipHorizontal
WaitTime
Worksheets(2).Shapes(1).Delete
WaitTime
Counter = Counter + 1
Loop Until Counter = 4
End Sub

Some of the msoTextEffect will not respond to the flip and rotate commands
so they act a little differently while the code is running. But it changes
the fonts on each loop and that is what I was looking for. Hope this helps
someone.

"JLGWhiz" wrote:

I want to use a loop with wordart and I want to change the font name on each
loop. If the font names have number equivalents I can do it easily.
However, I can't find any place that shows that font names have numbe
equivalents. Anyone have a suggestion.



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
Loops [email protected] Excel Discussion (Misc queries) 2 October 14th 06 02:52 PM
How can I lengthen the drop down Fonts list to show more fonts at Moser D Excel Discussion (Misc queries) 1 February 5th 06 03:24 PM
HOW TO SAVE FILE NAMES IN COLOUR OR DIFFERENT FONTS Jedi Excel Worksheet Functions 1 June 8th 05 01:52 PM
Do loops within Do loops Linking to specific cells in pivot table Excel Programming 4 April 14th 05 08:47 AM
for each loops adncmm1980[_3_] Excel Programming 1 October 4th 04 12:56 PM


All times are GMT +1. The time now is 03:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"