Conditional formatting

  • Thread starter Thread starter Sandy
  • Start date Start date
S

Sandy

How can I enter that if a cell contains any text then the specified formats
will be met.
Thanks
Sandy
 
Try:

=ISTEXT(E1)

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
Replace @mailinator.com with @tiscali.co.uk
 
Thanks Sandy - obviously got it at same time you replied.
However if you get this how do I do the same for a cell with a date in it.
Sandy
 
Yes, two Sandy's posting almost the same formula at the same time - I began
to wonder if there was an echo in here. <g>

As to dates, well dates are just numbers formatted to look like a date so in
a general module enter the UDF:

Function TestDate(Here As Range)
TestDate = IsDate(Here.Value)
End Function

The in the Conditional formattng the formula:

=TestDate(D1)

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
Replace @mailinator.com with @tiscali.co.uk
 
Tried your solution - works great. When you mentioned that the date was
basically a number which reads as a date, I tried "=ISNUMBER(D1)" and found
it to do the same job - without having to add the function. (Not sure if
it's supposed to, but it does.)
Thanks again
Sandy
 
basically a number which reads as a date, I tried "=ISNUMBER(D1)" and
found it to do the same job

That of course will work for dates - because they are numbers - but it will
work for ALL numbers. If you are only ever going to have text or dates in
the cell then OK.
--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
Replace @mailinator.com with @tiscali.co.uk
 
You can use the CELL function

=LEFT(CELL("format",A1))="D"

will return TRUE if it is a date

all dates start with D, general formatting is G, currency C
 
An interesting alternative
Thank you
Sandy

Peo Sjoblom said:
You can use the CELL function

=LEFT(CELL("format",A1))="D"

will return TRUE if it is a date

all dates start with D, general formatting is G, currency C
 
Back
Top