ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Conditional formatting if a cell contains a formula (https://www.excelbanter.com/excel-worksheet-functions/210062-conditional-formatting-if-cell-contains-formula.html)

tsbarr

Conditional formatting if a cell contains a formula
 
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

Conditional formatting if a cell contains a formula
 
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

"tsbarr" wrote:

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


Ashish Mathur[_2_]

Conditional formatting if a cell contains a formula
 
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" wrote in message
...
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




All times are GMT +1. The time now is 04:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com