ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Font Examples via a Macro (https://www.excelbanter.com/excel-programming/322090-font-examples-via-macro.html)

L. Howard Kittle

Font Examples via a Macro
 
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



Tom Ogilvy

Font Examples via a Macro
 
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

--
Regards,
Tom Ogilvy


"L. Howard Kittle" wrote in message
...
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





L. Howard Kittle

Font Examples via a Macro
 
Hi Tom,

I see my thanks did not get through.

So again...

Thank you!

Regards,
Howard

"L. Howard Kittle" wrote in message
...
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





All times are GMT +1. The time now is 11:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com