Logical function for finding different formated cells

  • Thread starter Thread starter SP
  • Start date Start date
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
 
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")
 
There is no in-built function to return the font size. You would need
a user-defined function in VBA.

Hope this helps.

Pete
 
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
 
Back
Top