Logical function for finding different formated cells

S

SP

Hi,
I am interesting in such question:

I have table with two types of cell formating, one with font 12 and one
with font 10. Is there a function to do something like this:
= IF (in target cell font is 12, result A)
= IF (in target cell font is 10, result B)

Thanks,

Svilen
 
G

Gary''s Student

Say we want to test the font size in A1.

First install this tiny UDF:

Function fontsize(r As Range) As Integer
fontsize = r.Font.Size
End Function

then in another cell:

=IF(fontsize(A1)=11, "result A","result B")
 
P

Pete_UK

There is no in-built function to return the font size. You would need
a user-defined function in VBA.

Hope this helps.

Pete
 
S

SP

Gary''s Student said:
Say we want to test the font size in A1.

First install this tiny UDF:

Function fontsize(r As Range) As Integer
fontsize = r.Font.Size
End Function

then in another cell:

=IF(fontsize(A1)=11, "result A","result B")

Thank you very much for the formula code!

Do you have an idea how to do it for colors as well? I mean, the color
of background and/or the color of font.

Svilen
 
Top