Conditional formatting if a cell contains a formula

T

tsbarr

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
 
M

Mike H

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
 
A

Ashish Mathur

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
 

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