+ Reply to Thread
Results 1 to 3 of 3

Conditional Formatting if cell content is a formula

Hybrid View

  1. #1
    oldsambvca
    Guest

    Conditional Formatting if cell content is a formula

    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!

  2. #2
    Bob Phillips
    Guest

    Re: Conditional Formatting if cell content is a formula

    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)

    "oldsambvca" <[email protected]> wrote in message
    news:[email protected]...
    > 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!




  3. #3
    LanceB
    Guest

    RE: Conditional Formatting if cell content is a formula

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

    Lance

    "oldsambvca" wrote:

    > 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!


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1