+ Reply to Thread
Results 1 to 6 of 6

How do I change the color of a cell depending on the result of the function in that cell

  1. #1
    Mo Childs
    Guest

    How do I change the color of a cell depending on the result of the function in that cell

    In other words how do I find the cell the formula is returning a result
    to in order to change (say) the interio color of the cell depending on
    the result of the formula?

    --
    Mo

  2. #2
    Tom Ogilvy
    Guest

    Re: How do I change the color of a cell depending on the result of the function in that cell

    Look at Format => Conditional Formatting in the menu.

    --
    Regards,
    Tom Ogilvy


    "Mo Childs" <zb.puvyqf@tznvy.pbz> wrote in message
    news:8AO9f.1204$721.355@newsfe3-win.ntli.net...
    > In other words how do I find the cell the formula is returning a result
    > to in order to change (say) the interio color of the cell depending on
    > the result of the formula?
    >
    > --
    > Mo




  3. #3
    Mo Childs
    Guest

    Re: How do I change the color of a cell depending on the result of the function in that cell

    Tom Ogilvy wrote:

    > Look at Format => Conditional Formatting in the menu.


    Thanks, but I don't want to use conditional formatting, I want to know
    how to do it from my own function.

    I tried ActiveCell.Interior.ColorIndex = RGB(128, 0, 0) from within the
    formula but that doesn't change the color of the cel as I thought it
    might. I assume the cell that the formula returns a value to isn't
    necessarily the active cell.

    --
    Mo

  4. #4
    Bob Phillips
    Guest

    Re: How do I change the color of a cell depending on the result of the function in that cell

    Colorindex is a number, an index into the 56 colour palette. So red would
    be

    Activecell.Interior.Colorindex = 3

    If you want to use RGB, use the Color property, but be aware Excel will map
    it to the closest colour on that same 56 colour palette.

    And finally, just to cheer you up, you can't set the colour from a worksheet
    function, just return a value. So it won't work anyway.

    Tom was right, use Conditional formatting :-)).

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Mo Childs" <zb.puvyqf@tznvy.pbz> wrote in message
    news:dJO9f.15487$Sx4.9925@newsfe3-gui.ntli.net...
    > Tom Ogilvy wrote:
    >
    > > Look at Format => Conditional Formatting in the menu.

    >
    > Thanks, but I don't want to use conditional formatting, I want to know
    > how to do it from my own function.
    >
    > I tried ActiveCell.Interior.ColorIndex = RGB(128, 0, 0) from within the
    > formula but that doesn't change the color of the cel as I thought it
    > might. I assume the cell that the formula returns a value to isn't
    > necessarily the active cell.
    >
    > --
    > Mo




  5. #5
    Tom Ogilvy
    Guest

    Re: How do I change the color of a cell depending on the result of the function in that cell

    Just to add, when you ask a question that has an obvious answer, but you
    don't want the obvious answer, why not say that in the problem statement and
    that will cut down (won't necessarily eliminate) the number of people
    providing the obvious answer.

    --
    Regards,
    Tom Ogilvy


    "Mo Childs" <zb.puvyqf@tznvy.pbz> wrote in message
    news:dJO9f.15487$Sx4.9925@newsfe3-gui.ntli.net...
    > Tom Ogilvy wrote:
    >
    > > Look at Format => Conditional Formatting in the menu.

    >
    > Thanks, but I don't want to use conditional formatting, I want to know
    > how to do it from my own function.
    >
    > I tried ActiveCell.Interior.ColorIndex = RGB(128, 0, 0) from within the
    > formula but that doesn't change the color of the cel as I thought it
    > might. I assume the cell that the formula returns a value to isn't
    > necessarily the active cell.
    >
    > --
    > Mo




  6. #6
    Tom Ogilvy
    Guest

    Re: How do I change the color of a cell depending on the result of the function in that cell

    Just to add, when you ask a question that has an obvious answer, but you
    don't want the obvious answer, why not say that in the problem statement and
    that will cut down (won't necessarily eliminate) the number of people
    providing the obvious answer.

    --
    Regards,
    Tom Ogilvy


    "Mo Childs" <zb.puvyqf@tznvy.pbz> wrote in message
    news:dJO9f.15487$Sx4.9925@newsfe3-gui.ntli.net...
    > Tom Ogilvy wrote:
    >
    > > Look at Format => Conditional Formatting in the menu.

    >
    > Thanks, but I don't want to use conditional formatting, I want to know
    > how to do it from my own function.
    >
    > I tried ActiveCell.Interior.ColorIndex = RGB(128, 0, 0) from within the
    > formula but that doesn't change the color of the cel as I thought it
    > might. I assume the cell that the formula returns a value to isn't
    > necessarily the active cell.
    >
    > --
    > Mo




+ 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