+ Reply to Thread
Results 1 to 12 of 12

Conditional formatting: how to change row colour and apply rule to a whole column

  1. #1
    Registered User
    Join Date
    05-08-2013
    Location
    Greenwich
    MS-Off Ver
    Excel 2010
    Posts
    5

    Conditional formatting: how to change row colour and apply rule to a whole column

    I have followed the advice in the thread: http://www.excelforum.com/excel-gene...html?p=1899924 but I wondered if anyone knows what formula to enter so that I can apply the above principle to a whole column?

    I used the formula to get a row to change colour when a particular cell is entered. So, when something is entered into A1, the cell changes colour. And I can get the row to change colour by copying the format of cell A1 across the whole row.
    =$a$1<>""

    What I need to do, though, is get the same rule to apply to the whole column A so, for e.g. when I enter text in cell A1, the whole of row 1 will change colour and when I enter text in cell A2, I want row 2 to change colour, A3 for the whole of row 3 etc. etc. How can I do this without having to create a new rule for each row?

    Thanks!

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Conditional formatting: how to change row colour and apply rule to a whole column

    try
    =$a1<>""
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Conditional formatting: how to change row colour and apply rule to a whole column

    You'll need two CF rules

    1. Select all of your data cells A1-Z(n)
    2. Select CF new rule
    3. Select "Use a formula......" at the bottom
    4. In the formula bar enter =$A1<>""
    5. Set the row format
    6. Select New rule
    7. Select "Use a formula"
    8 Enter =A$1<>""
    9 Set the column format
    10. Rearrange the order of the CF rules to suit column or row 1st
    11. Select "Stop If True" for the 1st condition

    Voila.......... All selected cells should now be conditionally formatted
    Elegant Simplicity............. Not Always

  4. #4
    Registered User
    Join Date
    05-08-2013
    Location
    Greenwich
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Conditional formatting: how to change row colour and apply rule to a whole column

    Hi, thanks - I have used that formula and it works for the cell. What I want to know is how do I apply that formula to a whole column. So, I want a situation where, if I enter something into cell A1, row 1 changes colour. If I enter something into A2, row 2 changes colour. etc. I can't figure out how to apply the =$a1<>"" principle to the whole column without having to create a new rule for each row.

  5. #5
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Conditional formatting: how to change row colour and apply rule to a whole column

    Step 1 says ........... Select all of your data cells A1-Z(n)

    The conditional format will be applied to all cells with relative references correctly applied

  6. #6
    Registered User
    Join Date
    05-08-2013
    Location
    Greenwich
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Conditional formatting: how to change row colour and apply rule to a whole column

    Thanks AndyLitch, that's the closest I've come to getting it to work! It has certainly highlighted the rows where the particular cell in question (in column W, in my spreadsheet) has been filled in, but it has also randomly changed other columns to colour too. What I was hoping for is a situation where if I put in a particular date in a cell column W, the whole row in question will change column, but if that cell remains blank, the row remains uncoloured.

    I've attached a copy of the screenshot of the rules I have input. Any ideas where I have gone wrong?
    Attached Images Attached Images

  7. #7
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Conditional formatting: how to change row colour and apply rule to a whole column

    The other thing you must ensure is that you select the topleft data cell to the bottom right

    The CF functions I quoted you were relative to cell A1 being the top left cell

    If that isn't the case you need to replace the A1 references with references to the top left AND selected cell.(noting the relative position of the $ signs)

    From what I see, I think your top left data cell is A4

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Conditional formatting: how to change row colour and apply rule to a whole column

    You don't need 2 rules for this, delete the first one.

    Actually, probably best to delete all conditional formatting, select A4:X1076, goto conditional formatting, new rule, enter this formula.

    =$W4<>""

    and format as desired.
    Last edited by Norie; 05-08-2013 at 09:30 AM.
    If posting code please use code tags, see here.

  9. #9
    Registered User
    Join Date
    05-08-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Conditional formatting: how to change row colour and apply rule to a whole column

    try this baddy,

    =$a1<>""

  10. #10
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Conditional formatting: how to change row colour and apply rule to a whole column

    Quote Originally Posted by Blogspot View Post
    I have followed the advice in the thread: http://www.excelforum.com/excel-gene...html?p=1899924 but I wondered if anyone knows what formula to enter so that I can apply the above principle to a whole column?

    I used the formula to get a row to change colour when a particular cell is entered. So, when something is entered into A1, the cell changes colour. And I can get the row to change colour by copying the format of cell A1 across the whole row.
    =$a$1<>""

    What I need to do, though, is get the same rule to apply to the whole column A so, for e.g. when I enter text in cell A1, the whole of row 1 will change colour and when I enter text in cell A2, I want row 2 to change colour, A3 for the whole of row 3 etc. etc. How can I do this without having to create a new rule for each row?

    Thanks!
    Guess I don't understand English

  11. #11
    Registered User
    Join Date
    05-08-2013
    Location
    Greenwich
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Conditional formatting: how to change row colour and apply rule to a whole column

    Thanks so much martindwilson, AndyLitch, Norie and sinha.riteshabap. That formula has worked!

  12. #12
    Registered User
    Join Date
    05-08-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Conditional formatting: how to change row colour and apply rule to a whole column

    u welcome dear

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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