Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Cycle through all the available Fonts

I would like to be able to take a list of the same phrase and assign a
different font to each line. I am trying to see what the text would
look like with each font. My problem is I do not know how to refer to
each font other than by name. It cant just use selection.font.name=1
and so on. Is there some way to refer to a font other than by name?

Thanks
Scott

Sub font()
I = 1
For Each cell In Selection
cell.font.Name = I
Cells(cell.Row, cell.Column + 1) = cell.font.Name
I = I + 1
Next cell

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Cycle through all the available Fonts

Scott,

Try something like


Dim CBX As Office.CommandBarComboBox
Dim Ndx As Long
Set CBX = Application.CommandBars.FindControl(ID:=1728)
For Ndx = 1 To CBX.ListCount
Cells(Ndx, 1).Value = CBX.List(Ndx)
Cells(Ndx, 2).Value = CBX.List(Ndx)
Cells(Ndx, 2).Font.Name = CBX.List(Ndx)
Next Ndx



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Scott Riddle" wrote in message
om...
I would like to be able to take a list of the same phrase and

assign a
different font to each line. I am trying to see what the text

would
look like with each font. My problem is I do not know how to

refer to
each font other than by name. It cant just use

selection.font.name=1
and so on. Is there some way to refer to a font other than by

name?

Thanks
Scott

Sub font()
I = 1
For Each cell In Selection
cell.font.Name = I
Cells(cell.Row, cell.Column + 1) = cell.font.Name
I = I + 1
Next cell

End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default Cycle through all the available Fonts

I am Y.A. in awe - the crowd chants "Chip! Chip!"

On Fri, 8 Aug 2003 14:09:40 -0500, "Chip Pearson"
wrote:

Dim CBX As Office.CommandBarComboBox
Dim Ndx As Long
Set CBX = Application.CommandBars.FindControl(ID:=1728)
For Ndx = 1 To CBX.ListCount
Cells(Ndx, 1).Value = CBX.List(Ndx)
Cells(Ndx, 2).Value = CBX.List(Ndx)
Cells(Ndx, 2).Font.Name = CBX.List(Ndx)
Next Ndx



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC

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 do I make a graph with 2-cycle X 3-cycle log-log graph paper? Charles A. Wilson Charts and Charting in Excel 1 December 17th 09 03:03 AM
Cycle Times PAL Excel Worksheet Functions 4 June 25th 09 09:31 PM
2 cycle logarithmic? Amanda Charts and Charting in Excel 1 January 29th 07 08:38 AM
How do I keep result from 1 iteration cycle to use in next cycle? sgl8akm Excel Discussion (Misc queries) 0 July 27th 06 08:28 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


All times are GMT +1. The time now is 04:29 PM.

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"