Font Examples via a Macro

  • Thread starter Thread starter L. Howard Kittle
  • Start date Start date
L

L. Howard Kittle

Hi Excel Experts and Users,

Excel 2002 SP3

Is there a way to type a string into a cell and run a macro that will
produce an example of the Excel fonts using the string text?

So, if I enter DESPERADO in A1, I get an example of all available fonts of
desperado in A2 through A??.

Thanks,
Regards,
Howard
 
Adaptation of John Walkenbach's code;
http://j-walk.com/ss/excel/tips/tip79.htm

Sub ShowInstalledFonts()
Set FontList =
Application.CommandBars("Formatting").FindControl(Id:=1728)

' If Font control is missing, create a temp CommandBar
If FontList Is Nothing Then
Set TempBar = Application.CommandBars.Add
Set FontList = TempBar.Controls.Add(Id:=1728)
End If

' Put the fonts into column A
' Range("A:A").ClearContents
For i = 0 To FontList.ListCount - 1
Cells(i + 3, 1).Value = Range("A2").Value
Cells(i + 3, 1).Font.Name = FontList.List(i + 1)
Next i

' Delete temp CommandBar if it exists
On Error Resume Next
TempBar.Delete
End Sub
 
Hi Tom,

I see my thanks did not get through.

So again...

Thank you!

Regards,
Howard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top