+ Reply to Thread
Results 1 to 6 of 6

Colour a row if eg. a2 is red or c2 is red

  1. #1
    Registered User
    Join Date
    11-26-2012
    Location
    Chorley, Lancashire
    MS-Off Ver
    Excel 2010
    Posts
    6

    Colour a row if eg. a2 is red or c2 is red

    Hi,

    How do I colour an entire row if certain cells are filled with a colour?

    eg:

    A2 is red, F2 is blue etc then the entire row would colour yellow or even P2 would colour yellow


    Many thanks
    H

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,105

    Re: Colour a row if eg. a2 is red or c2 is red

    It depends on how you coloured A2 red. If it was done simply by applying shading - you will need VBA, as the color is NOT data. If it was done by conditional formatting, then you can use the same rule to apply to other cell(s) row(s).

    So, how was it made red?
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Registered User
    Join Date
    11-26-2012
    Location
    Chorley, Lancashire
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Colour a row if eg. a2 is red or c2 is red

    It was manually coloured :-(

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,105

    Re: Colour a row if eg. a2 is red or c2 is red

    So is there any reason why you manually colored A2 red. Like - the value was less than 100, or what??

    More details needed!!!! Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

  5. #5
    Registered User
    Join Date
    11-26-2012
    Location
    Chorley, Lancashire
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Colour a row if eg. a2 is red or c2 is red

    I didn't manually color the cells - I was sent the spreadsheet.

    I have attached a small sample workbook. The data is an extract of my workbook so is truly representative of my real data.

    Many thanks for your help.
    Attached Files Attached Files

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,105

    Re: Colour a row if eg. a2 is red or c2 is red

    A different question, now that I can see what you want. You do need a little VBA.

    Please Login or Register  to view this content.
    How to install your new code
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Press Alt+F11 to open the Visual Basic Editor
    Choose Insert > Module
    Edit > Paste the macro into the module that appeared
    Close the VBEditor
    Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)
    [B][I]

    Then with the colour you want to count filled in somewhere as a reference cell (I used C2), use this formula:

    =IF(CountCellsByColor(J4:AA4,$C$2)>0,"SI","")

    If you change the shading of any cells, you need to refresh the sheet, by hitting F9 (Data/Calculation/Calculate Now)
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 6
    Last Post: 04-11-2016, 09:48 AM
  2. [SOLVED] Search cells based on student name, cell background colour and return a tally for colour
    By drof_06 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-26-2016, 04:31 AM
  3. Replies: 2
    Last Post: 02-13-2015, 03:06 PM
  4. VBA to colour data labels same as line colour - dynamic chart
    By Jabba69 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-06-2014, 10:59 AM
  5. Replies: 1
    Last Post: 09-12-2013, 02:09 PM
  6. Macro that clears contents of all cells of certain colour (colour 35) in all sheets
    By Hanskubansku in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-25-2012, 07:33 AM
  7. Replies: 2
    Last Post: 06-07-2011, 07:00 AM

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