Using font elements as condition criteria

S

StorageHawk

Does anyone know how to use font elements like bold, italic, underline, etc.
as criteria for a formula to return the value from a cell? I am trying to
use bold $ values as the criterion for pulling the $ value into another cell.
I can do the entire column but all I want are the cells with totals and not
the individual component sales figures. This is in a very large spreadsheet
and was already formatted when I received it, so I just wanted to gather the
data I want and pull it into another column. ???? Thanks in advance for any
help.
 
G

Gary''s Student

Here is part of your answer. We create a UDF that will return 1 if the
reference is currency and the font is bold:

Function hawk(r As Range) As Integer
v = r.Text
If Left(v, 1) = "$" And r.Font.Bold = True Then
hawk = 1
Else
hawk = 0
End If
End Function

So if A50 is dollars/bold then
=hawk(A50) will give a 1.

Is this of any help??
 
S

StorageHawk

I will have to try that and see if I can get the answer to pick up the value
in that cell. Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top