Displaying and Printing the Name of Size of Font in Excel

I am printing 20-30 spreadsheets, each using a different font and various font sizes for a selection committee.  Can I display and print the name and size of the font being used in the column (or cell) above.
LVL 1
Bill GoldenExecutive Managing MemberAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Martin LissOlder than dirtCommented:
You could modify this macro to suit your situation. Currently it displays the font name and size of C2's font in C1.

Sub DisplayFont()
Range("C1") = "Font name: " & Range("C2").Font.Name & " Font Size: " & Range("C2").Font.Size
End Sub

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Saqib Husain, SyedEngineerCommented:
You can use a UDF for this

Enter this code in a new module

Function fontnamesize(rng As Range)
fontnamesize = rng.Font.Name & " " & rng.Font.Size
End Function


In excel enter this formula

=fontnamesize(B4)

where B4 is the address of the cell whose font properties needs to be returned.
0
Martin LissOlder than dirtCommented:
Using my code as a basis here's another UDF

Function DisplayFont(r As Range) As String
DisplayFont = "Font name: " & r.Offset(1, 0).Font.Name & " Font Size: " & r.Offset(1, 0).Font.Size
End Function

Open in new window


Usage: =DisplayFont((C2))
0
CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

dsackerContract ERP Admin/ConsultantCommented:
It has to be done from a VBA macro. Something like this would work:
Public Sub FontName()
    If ActiveCell.Row > 1 Then
        ActiveCell.Offset(-1, 0).Value = ActiveCell.Font.Name & " " & ActiveCell.Font.Size
    End If
End Sub

Open in new window

Make sure you are not highlighting anything on row 1, since you want the display to be above it.
0
Bill GoldenExecutive Managing MemberAuthor Commented:
It appears that each solution would work.  However, given that I am lost in VBA, I ended up using Martin's first solution:

Sub DisplayFont()
Range("C1") = "Font name: " & Range("C2").Font.Name & " Font Size: " & Range("C2").Font.Size
End Sub

and built it into this:

Sub DisplayFontandSizeonIncomeStatement()
Range("E61") = " " & Range("B6").Font.Name & " " & Range("B6").Font.Size
Range("E62") = " " & Range("E9").Font.Name & " " & Range("E9").Font.Size
Range("E63") = " " & Range("E10").Font.Name & " " & Range("E10").Font.Size
Range("G63") = " " & Range("G10").Font.Size
Range("J63") = " " & Range("J10").Font.Name & " " & Range("J10").Font.Size
Range("L63") = " " & Range("L10").Font.Size
Range("O63") = " " & Range("O10").Font.Size
Range("Q63") = " " & Range("Q10").Font.Size
Range("E65") = " " & Range("B69").Font.Name & " " & Range("B69").Font.Size
Range("B64") = " " & Range("B60").Font.Name & " " & Range("B60").Font.Size
Range("C64") = " " & Range("C60").Font.Size
Range("D64") = " " & Range("D60").Font.Size
Range("E64") = " " & Range("E60").Font.Name & " " & Range("E60").Font.Size
Range("G64") = " " & Range("G60").Font.Size
Range("I64") = " " & Range("I60").Font.Size
Range("J64") = " " & Range("J60").Font.Name & " " & Range("J60").Font.Size
Range("K64") = " " & Range("K60").Font.Size
Range("L64") = " " & Range("L60").Font.Size
Range("M64") = " " & Range("M60").Font.Size
Range("N64") = " " & Range("N60").Font.Size
Range("O64") = " " & Range("O60").Font.Size
Range("Q64") = " " & Range("Q60").Font.Size
End Sub

Thanks guys...
0
Martin LissOlder than dirtCommented:
You're welcome and I'm glad I was able to help. My profile contains links to some articles that I've written that might interest you.

Marty - MVP 2009 to 2015
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.