Formula to detect font

D

Dodo2u

Is it possible to get e.g. in cell A1 the name of the font that is used in
a different cell e.g. H12?

Thanks for your help!
 
S

Steve Yandl

You could write a simple function and place it in a module:

Public Function Fontrprt(strCell) As String
Fontrprt = strCell.Font.Name
End Function


Then, in your workbook you could enter
=Fontrprt(A1)
to get the font used in cell A1. The function will return an error if you
have it act on a cell with more than one font used.

Steve
 
D

David McRitchie

On my formula.htm page

Function fontinfo(cell As Range) As String
fontinfo = cell.FONT.Name & " -- " & cell.FONT.Size
If Left(cell.FONT.FontStyle, 7) = "Regular" Then
fontinfo = Trim(fontinfo & Mid(cell.FONT.FontStyle, 8, 100))
Else
fontinfo = Trim(fontinfo & " " & cell.FONT.FontStyle)
End If
End Function

An example of use, depending on what font you actually used in your
table the formula shown might be substituted by something such as:
Arial -- 12 Bold
Webdings -- 12
Wingdings 2 -- 12
 
Top