Conditional Formatting

  • Thread starter Thread starter Robin
  • Start date Start date
R

Robin

Hello

I would like to use a Check for Underline in conditional formatting, is it
possible andwhat is the syntax for the command

Robin
 
AFAIK, there's no way to check for whether an underline has been applied
without using VBA. You could use this UDF:

Public Function CheckForUnderline(Optional rCell As Range) As Boolean
Application.Volatile
If rCell Is Nothing Then Set rCell = Application.Caller(1)
CheckForUnderline = Not _
rCell.Font.Underline = xlUnderlineStyleNone
End Function

Then in your CF:

Formula is =CheckForUnderline(A1)

Note that the UDF doesn't differentiate among all the types of
underline, it returns True if any are applied.

Note also that UDF's and CF often don't get along particularly well
(though this worked in the workbook I tested). There also may be other
ways to accomplish what you're after, but I'm not sure what that is...
 
Back
Top