+ Reply to Thread
Results 1 to 13 of 13

Compare two colums from different sheets and to highlight the different cell in sheet 2

  1. #1
    Registered User
    Join Date
    09-21-2013
    Location
    chennai,India
    MS-Off Ver
    Excel 2010
    Posts
    75

    Compare two colums from different sheets and to highlight the different cell in sheet 2

    Hi All,

    I want to write a Macro which will compare two sheets in an excel and will highlight the data which is not similar between the two sheets in sheet 2.

    I have two columns which is present in both cells.

    Columns :item number and status.

    I want to search the item number first, if it is present in both the sheets then it should check the status.If the item number is not present in both sheets then i dont want to compare the status.Those data's are not required.

    If item number is present in both the sheets, then it should check the status.if it find any mismatch in the status column then the entire row should be highlighted in sheet 2.

    thanks in advance

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Compare two colums from different sheets and to highlight the different cell in sheet

    Will both workbooks be open? Will they both have a fixed name? filepath?

    Can the item number from wb1 be found anywhere in wb2?
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Registered User
    Join Date
    09-21-2013
    Location
    chennai,India
    MS-Off Ver
    Excel 2010
    Posts
    75

    Re: Compare two colums from different sheets and to highlight the different cell in sheet

    HI Solus,

    I am telling about two sheets which is in same workbook.. like sheet 1 and sheet 2.

    Item number column is present in both the sheet1 and 2.

  4. #4
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Compare two colums from different sheets and to highlight the different cell in sheet

    My mistake, can that item number be in any row in the second sheet or does if have to correspond to the row number in the first sheet?

  5. #5
    Registered User
    Join Date
    09-21-2013
    Location
    chennai,India
    MS-Off Ver
    Excel 2010
    Posts
    75

    Re: Compare two colums from different sheets and to highlight the different cell in sheet

    can be in any row..

    Actually sheet 2 have less number of rows comparing to sheet 1.

  6. #6
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Compare two colums from different sheets and to highlight the different cell in sheet

    maybe
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    09-21-2013
    Location
    chennai,India
    MS-Off Ver
    Excel 2010
    Posts
    75

    Re: Compare two colums from different sheets and to highlight the different cell in sheet

    Hi solus ,

    its not working


    i have attached the sample sheet. This will help you to provide the exact solution.
    Attached Files Attached Files

  8. #8
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Compare two colums from different sheets and to highlight the different cell in sheet

    Hi Thinker8,
    try it
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    09-21-2013
    Location
    chennai,India
    MS-Off Ver
    Excel 2010
    Posts
    75

    Re: Compare two colums from different sheets and to highlight the different cell in sheet

    Hi Nilem,

    Its working in the sample sheet which was attached in the previous thread.

    But my original sheet has more that 2000 rows and macro is not working.. say out of range,...


    what it means : Cells(Rows.Count, 4).

  10. #10
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Compare two colums from different sheets and to highlight the different cell in sheet

    2000 rows is very small. Can you can show your original file?
    Cells(Rows.Count, 4) means cell D1048576

  11. #11
    Registered User
    Join Date
    09-21-2013
    Location
    chennai,India
    MS-Off Ver
    Excel 2010
    Posts
    75

    Re: Compare two colums from different sheets and to highlight the different cell in sheet

    Hi I have attached the original sheet..

    In that sheet highlighted columns are to be used for comparison.

    I hope you can understand if you see the sheet.
    Attached Files Attached Files

  12. #12
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Compare two colums from different sheets and to highlight the different cell in sheet

    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    09-21-2013
    Location
    chennai,India
    MS-Off Ver
    Excel 2010
    Posts
    75

    Re: Compare two colums from different sheets and to highlight the different cell in sheet

    WOW.. Its working

+ 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. [SOLVED] Compare name list (First name, last name) on two different sheets and highlight
    By badboynads in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-25-2013, 07:37 AM
  2. Compare, Find and Highlight Duplicates in multiple sheets
    By EvilleT in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-19-2013, 08:42 PM
  3. MAcro to Compare two colums in different sheet and paste corresponding data.
    By avinash.aswani in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-10-2013, 11:25 AM
  4. Replies: 9
    Last Post: 04-18-2013, 03:54 PM
  5. Compare two sheets and highlight/mark differences
    By richarddd in forum Excel General
    Replies: 4
    Last Post: 04-03-2009, 09:54 AM

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