+ Reply to Thread
Results 1 to 12 of 12

cells automatically colour differently with 'what if' scenarios

Hybrid View

  1. #1
    Kenny @ TLGC
    Guest

    cells automatically colour differently with 'what if' scenarios

    I want to add YES or NO to a cell in EXCEL. If I type YES I want cell to
    automatically colour GREEN. If I type NO I want cell to automatically colour
    RED with the adjacent cell also to colour RED.
    Any help apprecaited.

  2. #2
    JE McGimpsey
    Guest

    Re: cells automatically colour differently with 'what if' scenarios

    Take a look at Conditional Formatting in XL Help.

    In article <[email protected]>,
    Kenny @ TLGC <Kenny @ [email protected]> wrote:

    > I want to add YES or NO to a cell in EXCEL. If I type YES I want cell to
    > automatically colour GREEN. If I type NO I want cell to automatically colour
    > RED with the adjacent cell also to colour RED.
    > Any help apprecaited.


  3. #3
    ben
    Guest

    Re: cells automatically colour differently with 'what if' scenario

    this won't help the cell adjacent to it though

    insert this in the worksheet object
    but the interior.colorindex will change the background color
    the font.colorindex will change the font color, since you did not specify
    the one you needed I reccomend you comment out or delete the one you don't
    want or else you will not see what you type


    Private Sub Worksheet_Change(ByVal Target As Range)
    if target.value = "YES" then
    target.Font.ColorIndex = 4
    target.Interior.ColorIndex = 4
    end if
    if target.value = "NO" then
    range(cells(target.row,target.column),cells(target.row,target.column+1)).select
    selection.Interior.ColorIndex = 3
    selection.Font.ColorIndex = 3
    end if
    end sub
    "JE McGimpsey" wrote:

    > Take a look at Conditional Formatting in XL Help.
    >
    > In article <[email protected]>,
    > Kenny @ TLGC <Kenny @ [email protected]> wrote:
    >
    > > I want to add YES or NO to a cell in EXCEL. If I type YES I want cell to
    > > automatically colour GREEN. If I type NO I want cell to automatically colour
    > > RED with the adjacent cell also to colour RED.
    > > Any help apprecaited.

    >


  4. #4
    ben
    Guest

    Re: cells automatically colour differently with 'what if' scenario

    conditional formatting won't help the cell adjacent to it though

    insert this in the worksheet object
    but the interior.colorindex will change the background color
    the font.colorindex will change the font color, since you did not specify
    the one you needed I reccomend you comment out or delete the one you don't
    want or else you will not see what you type


    Private Sub Worksheet_Change(ByVal Target As Range)
    if target.value = "YES" then
    target.Font.ColorIndex = 4
    target.Interior.ColorIndex = 4
    end if
    if target.value = "NO" then
    range(cells(target.row,target.column),cells(target.row,target.column+1)).select
    selection.Interior.ColorIndex = 3
    selection.Font.ColorIndex = 3
    end if
    end sub


    "JE McGimpsey" wrote:

    > Take a look at Conditional Formatting in XL Help.
    >
    > In article <[email protected]>,
    > Kenny @ TLGC <Kenny @ [email protected]> wrote:
    >
    > > I want to add YES or NO to a cell in EXCEL. If I type YES I want cell to
    > > automatically colour GREEN. If I type NO I want cell to automatically colour
    > > RED with the adjacent cell also to colour RED.
    > > Any help apprecaited.

    >


  5. #5
    JE McGimpsey
    Guest

    Re: cells automatically colour differently with 'what if' scenario

    Of course it will...

    Select A1 & B1

    CF1: Formula is =($A1="YES")
    Format1: Green

    CF2: Formula is =($A1="NO")
    Format2: Red

    In article <[email protected]>,
    ben <[email protected]> wrote:

    > conditional formatting won't help the cell adjacent to it though


  6. #6
    Registered User
    Join Date
    05-20-2014
    Posts
    4

    Re: cells automatically colour differently with 'what if' scenarios

    Can you have a conditional format that says if Cell J1 is 'Yes' then cell D1 is colour filled a particular colour (but J1 is not colour filled)?

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2405
    Posts
    13,417

    Re: cells automatically colour differently with 'what if' scenarios

    Dammo666,
    on 5/20/2014 you wrote:

    Quote Originally Posted by Damo666 View Post
    Can you have a conditional format that says if Cell J1 is 'Yes' then cell D1 is colour filled a particular colour (but J1 is not colour filled)?
    Yes, you can. Have you found your solution, yet?

  8. #8
    JulieD
    Guest

    Re: cells automatically colour differently with 'what if' scenarios

    Hi

    this can be achieved via conditional formatting
    select the cell that you want to go green or red
    choose format / conditional formatting
    choose
    value is
    equal to
    type
    yes
    click format - choose green - ok
    choose ADD
    choose
    value is
    type
    no
    click format - choose red - ok twice

    now choose the cell that you want to go red if the previous cell goes red
    choose format / conditional formatting
    choose
    formula is
    type
    =$A1="NO"
    (where A1 is the cell reference of the previous cell)
    click format ...etc

    Cheers
    JulieD



    "Kenny @ TLGC" <Kenny @ [email protected]> wrote in message
    news:[email protected]...
    >I want to add YES or NO to a cell in EXCEL. If I type YES I want cell to
    > automatically colour GREEN. If I type NO I want cell to automatically
    > colour
    > RED with the adjacent cell also to colour RED.
    > Any help apprecaited.




  9. #9
    ben
    Guest

    Re: cells automatically colour differently with 'what if' scenario

    good point, never mind my post this is much smarter lol

    "JulieD" wrote:

    > Hi
    >
    > this can be achieved via conditional formatting
    > select the cell that you want to go green or red
    > choose format / conditional formatting
    > choose
    > value is
    > equal to
    > type
    > yes
    > click format - choose green - ok
    > choose ADD
    > choose
    > value is
    > type
    > no
    > click format - choose red - ok twice
    >
    > now choose the cell that you want to go red if the previous cell goes red
    > choose format / conditional formatting
    > choose
    > formula is
    > type
    > =$A1="NO"
    > (where A1 is the cell reference of the previous cell)
    > click format ...etc
    >
    > Cheers
    > JulieD
    >
    >
    >
    > "Kenny @ TLGC" <Kenny @ [email protected]> wrote in message
    > news:[email protected]...
    > >I want to add YES or NO to a cell in EXCEL. If I type YES I want cell to
    > > automatically colour GREEN. If I type NO I want cell to automatically
    > > colour
    > > RED with the adjacent cell also to colour RED.
    > > Any help apprecaited.

    >
    >
    >


  10. #10
    Tom Ogilvy
    Guest

    Re: cells automatically colour differently with 'what if' scenarios

    Look at Format=>Conditional Formatting

    you don't need code for this.

    --
    Regards,
    Tom Ogilvy

    "Kenny @ TLGC" <Kenny @ [email protected]> wrote in message
    news:[email protected]...
    > I want to add YES or NO to a cell in EXCEL. If I type YES I want cell to
    > automatically colour GREEN. If I type NO I want cell to automatically

    colour
    > RED with the adjacent cell also to colour RED.
    > Any help apprecaited.




  11. #11
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: cells automatically colour differently with 'what if' scenarios

    Damo666 welcome to the forum

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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