Conditional Formatting if cell content is a formula

G

Guest

I would like to create a conditional format based on the content of the cell,
rather than the value.

I have a spreadsheet that has empty cells, cells with values of 1 and 2, and
cells that will have values of 0 based on 1-1 or 2-2. I do not want to
highlight the blank cells, I only want to highlight the cells that contain a
formula, even if the formula's value is 0. How can I do that? "Cell Value"
looks at the result of the formula and highlights all blank cells. I cannot
figure out what formula to use to look at the cell content rather than the
cell value.

For example:

Cell A1 is blank -- no highlight
Cell A2 value is 1 -- no highlight
Cell A3 value is 0 because formula is =1-1 -- highlight.

I only want to highlight the last cell because is contains a formula.

Thanks in advance!
 
B

Bob Phillips

Add a custom function like

Function Is(rng As Range) As Boolean
If rng.Count > 1 Then
IsFormula = CVErr(xlErrValue)
Else
IsFormula = rng.HasFormula
End If
End Function


and use =IsFormula(A1) in the CF


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
G

Guest

Format|conditional formatting
In the drop down "Formula is"
=AND(A1=0,A1<>"")

Lance
 

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