Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Conditional formatting if a cell contains a formula

0 views
Skip to first unread message

tsbarr

unread,
Nov 12, 2008, 11:58:15 AM11/12/08
to
I would like to apply conditional formatting if a cell contains a formula as
opposed to an entered number. I would think that is doable somehow using a
Formula Is condition, but I have not been able to figure it out. I thought
the cell function might be the one to use, but all I can see is being able to
evaluate if the cell contains a value, text or blank. The formula results in
a value, and an input number is a value, so going that route hasn't panned
out. If anybody has any suggestions, please let me know!

Thanks,
Tim

Mike H

unread,
Nov 12, 2008, 12:13:02 PM11/12/08
to
Hi,

Try this. Alt +f11 to open vb editor. Right click 'This Workbook' and paste
the code below in.

The select your cell (say A1)and
Format|Conditional format
Formula is
=isformula(a1)
Pick a colour
OK

use format painter to copt the CF to other cells.


Function ISFORMULA(c As Range) As Boolean
ISFORMULA = c.HasFormula
End Function

Mike

Ashish Mathur

unread,
Nov 12, 2008, 6:54:48 PM11/12/08
to
Hi,

You may also try this

Go to insert name (name the formula as “cellhasformula”) and in the “Refers
to” box, type the following formula = get.cell(48,indirect(“rc”,false)).
Now in the conditional formatting dialog box, type =cellhasformula in the
"Formula is". Use the desired formatting.

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"tsbarr" <tsb...@discussions.microsoft.com> wrote in message
news:5F44F43E-19B5-4406...@microsoft.com...

0 new messages