+ Reply to Thread
Results 1 to 16 of 16

HELP: Need a quicker way to compare a range of columns using conditional formatting

  1. #1
    Registered User
    Join Date
    04-04-2014
    Location
    singapore
    MS-Off Ver
    Excel 2010
    Posts
    78

    HELP: Need a quicker way to compare a range of columns using conditional formatting

    Hi, I need a quicker way to compare a range of columns using conditional formatting

    I want to compare A2 & A1, B2 & B1, C2 & C1, D2 & D1, E2 & E1.

    How I do is one at a time.

    Example: Starting with cell B3, I use the rules "=B3<>A3" with the range "=$B$3:$B$12".

    Then i will repeat for cell D3, then F3, then H3 then finally J3.

    Instead of doing them one at a time, is there a quicker way to do this?

    Thanks

    I have attached a file for your reference. I did cell B3 as a sample.

    Thanks

    Comparison table.xlsx

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: HELP: Need a quicker way to compare a range of columns using conditional formatting

    Hi nez329

    You can cut and paste the FORMATS.

    Select a range of cells having the proper conditional format (e.g. B3:B12)
    Press CTRL-C to copy
    Select the first cell in the destination range (e.g. D3)
    Edit > Paste Special > Formats > OK

    Lewis

  3. #3
    Registered User
    Join Date
    04-04-2014
    Location
    singapore
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: HELP: Need a quicker way to compare a range of columns using conditional formatting

    Quote Originally Posted by LJMetzger View Post
    Hi nez329

    You can cut and paste the FORMATS.

    Select a range of cells having the proper conditional format (e.g. B3:B12)
    Press CTRL-C to copy
    Select the first cell in the destination range (e.g. D3)
    Edit > Paste Special > Formats > OK

    Lewis
    Oh, forgot to add that some of the data is strikethrough. So that will not be possible.

  4. #4
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: HELP: Need a quicker way to compare a range of columns using conditional formatting

    Yes, it is possible with a little VBA Macro trickery, unless someone else has some magical knowledge on how to do what you want without VBA. Your workbook can remain an .xlsx file if you desire, because the Macros are a one time only thing.

    Here is what you have to do:

    a. Save a Backup Copy of your file, in case disaster strikes.

    b. Install the macros that follow in an ordinary module in your Excel file. Alternately they can be installed in your PERSONAL.XLSB file (Excel 2010). Installation instructions below the macros.

    c. Run Macro SaveStrikeThroughCells() which saves the addresses of all the 'StrikeThrough' cells on the sheet.

    d. Cut and paste the Conditional Formats as many times as needed.

    e. Run Macro RestoreStrikeThroughCells() to restore the 'StrikeThrough' cells.

    f. Save your file if you are satisifed with the results. Save as .xlsx to remove the macros, or if you want to keep the macros save as .xlsm

    Lewis

    Please Login or Register  to view this content.
    ------------------
    0. To enable Macros and to Run Macros see the following:
    http://office.microsoft.com/en-us/ex...010031071.aspx
    http://office.microsoft.com/en-us/ex...010014113.aspx
    If help is still needed do a google search for 'youtube excel enable macro' and/or 'youtube excel run macro'.

    To access Visual Basic (VBA) (to cut and paste the above macros) see:
    http://www.ablebits.com/office-addin...a-macro-excel/

  5. #5
    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,936

    Re: HELP: Need a quicker way to compare a range of columns using conditional formatting

    Much easier/simpler way....
    open the CF window, and in the "applies to" section, click the range drop-down, hold down shift and then just select the other ranges (=$B$3:$B$12,$D$3:$D$12,$F$3:$F$12,$H$3:$H$12,$J$3:$J$12,$I$3:$I$12)
    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

  6. #6
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: HELP: Need a quicker way to compare a range of columns using conditional formatting

    Hold down the Ctrl and select J3:J12, H3:H12, F3:F12, D3:D12 and B3:B12. While B3 is still the active cell, make a new rule for conditional formatting using the below formula and format as per your choice.

    Please Login or Register  to view this content.
    Or you can do just reverse of it. i.e.

    Hold down the Ctrl and select B3:B12, D3:D12, F3:F12, H3:H12 and J3:J12. While J3 is still the active cell, make a new rule for conditional formatting using the below formula and format as per your choice.

    Please Login or Register  to view this content.
    Or even simpler.....

    Just apply conditional formatting in B3 by using the formula

    Please Login or Register  to view this content.
    and then double click on Format Painter Brush and apply the formatting on the desired ranges.
    Last edited by sktneer; 05-03-2014 at 02:20 PM.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  7. #7
    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,936

    Re: HELP: Need a quicker way to compare a range of columns using conditional formatting

    It was pointed out to me (by Lewis) that "applies to" is not an option in 2003 - excelent catch holding down shift and selecting the different ranges should still work though (as suggested by sktneer)

    However, Nez, I notice that the file you uploaded indicates 2007 or later (.xlsx), but your profile says 2003. Please update your profile as necessary, members tailor questions based on your excel version

  8. #8
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: HELP: Need a quicker way to compare a range of columns using conditional formatting

    In post #3 OP said:
    Oh, forgot to add that some of the data is strikethrough.
    I'm at a loss on how to maintain the strikethrough in Excel 2003, after replicating the Conditional Formatting manually. That's why I went to the VBA solution.

    Lewis

  9. #9
    Registered User
    Join Date
    04-04-2014
    Location
    singapore
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: HELP: Need a quicker way to compare a range of columns using conditional formatting

    Quote Originally Posted by FDibbins View Post
    Much easier/simpler way....
    open the CF window, and in the "applies to" section, click the range drop-down, hold down shift and then just select the other ranges (=$B$3:$B$12,$D$3:$D$12,$F$3:$F$12,$H$3:$H$12,$J$3:$J$12,$I$3:$I$12)
    Thanks. SHIFT did not work for me but CTRL did however.

    Quote Originally Posted by FDibbins View Post
    It was pointed out to me (by Lewis) that "applies to" is not an option in 2003 - excelent catch holding down shift and selecting the different ranges should still work though (as suggested by sktneer)

    However, Nez, I notice that the file you uploaded indicates 2007 or later (.xlsx), but your profile says 2003. Please update your profile as necessary, members tailor questions based on your excel version
    I am using 2007 at home. Created the workbook at home. But office is using 2003. So I am limited to 2003. Sktneer's 2nd option is most viable. However i do like to ask, will there be any implication between his method & doing it one at a time?

    Thanks

  10. #10
    Registered User
    Join Date
    04-04-2014
    Location
    singapore
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: HELP: Need a quicker way to compare a range of columns using conditional formatting

    Thanks sktneer, your 2nd option is most viable for me ATM.

  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,936

    Re: HELP: Need a quicker way to compare a range of columns using conditional formatting

    My apologies, I meant CTRL, not SHIFT

    When I need to use CF, I generally highlight my range/s 1st, then go in and create the rules. That way, they apply to the ranges from teh start, no need to mess around later

  12. #12
    Registered User
    Join Date
    04-04-2014
    Location
    singapore
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: HELP: Need a quicker way to compare a range of columns using conditional formatting

    Quote Originally Posted by LJMetzger View Post
    Yes, it is possible with a little VBA Macro trickery, unless someone else has some magical knowledge on how to do what you want without VBA. Your workbook can remain an .xlsx file if you desire, because the Macros are a one time only thing.
    Thanks LJMetzger for your effort. Will try this out when i find the courage, as i am not familar with VBA

  13. #13
    Registered User
    Join Date
    04-04-2014
    Location
    singapore
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: HELP: Need a quicker way to compare a range of columns using conditional formatting

    Quote Originally Posted by FDibbins View Post
    My apologies, I meant CTRL, not SHIFT
    NP

    Quote Originally Posted by FDibbins View Post
    My apologies, I meant CTRL, not SHIFT

    When I need to use CF, I generally highlight my range/s 1st, then go in and create the rules. That way, they apply to the ranges from teh start, no need to mess around later
    I see. OK thanks for the tip. I normally use that "applies t"o to select the range.

    Also, I intend to selecte the column titles (this will select the whole row for that column) instead as in my work, there are many rows & goes beyond the screen, & scrolling down to select the rows for every alternate column is a real hassle.
    This however will highlight my differences in my column header at row 2 even though the rules i indicate as "=J3<>I3"
    What is the point of indicating '3' at both J & I?

    Any suggestion to select that whole stretch of rows for 1 column.

    Alternatively, anyway to remove the CF for rows 1 & 2?

    Thanks
    Last edited by nez329; 05-03-2014 at 08:48 PM.

  14. #14
    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,936

    Re: HELP: Need a quicker way to compare a range of columns using conditional formatting

    when using CF, avoid using entire column or row ranges, CF can quickly become a resource-hog and slow things down.

    Once you have the last row identified, you can then (if you use "applies to") manually adjust the ranges

  15. #15
    Registered User
    Join Date
    04-04-2014
    Location
    singapore
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: HELP: Need a quicker way to compare a range of columns using conditional formatting

    Quote Originally Posted by FDibbins View Post
    when using CF, avoid using entire column or row ranges, CF can quickly become a resource-hog and slow things down.

    Once you have the last row identified, you can then (if you use "applies to") manually adjust the ranges
    I see what you mean. Thanks

    Thank to all the guys, for the help

  16. #16
    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,936

    Re: HELP: Need a quicker way to compare a range of columns using conditional formatting

    glad to help

+ 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. Conditional Formatting for cell range covering multiple rows and columns
    By edp428 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-09-2013, 02:02 PM
  2. Compare two columns (conditional formatting)
    By stephen.reilly in forum Excel General
    Replies: 17
    Last Post: 09-29-2013, 02:31 PM
  3. Conditional Formatting Help-What I want to do is compare them
    By manic2511 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-14-2007, 03:55 PM
  4. Conditional Formatting to Compare to Lists
    By John Michl in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-07-2006, 11:20 AM
  5. Replies: 3
    Last Post: 01-23-2006, 12:10 PM

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