+ Reply to Thread
Results 1 to 14 of 14

Compare Sheets Find Missing Data

  1. #1
    Registered User
    Join Date
    11-01-2012
    Location
    Iowa
    MS-Off Ver
    Excel 2010
    Posts
    8

    Compare Sheets Find Missing Data

    Hello and thank you in advance for your help.

    I have an excel workbook that has a master sheet that keeps track of items and there location that constantly changes and another sheet that keeps track of past locations and does not change. Currently when a record is changed in the master sheet the row is manually copied and pasted into the 2nd sheet. I would like a macro that would find items in the master sheet that are not in the 2nd sheet and copy them to the 2nd sheet when records change.

    Example:
    Day1 Workbook appears
    Master Sheet 2
    Equip # Location Equip # Location
    1 shop 1 shop
    2 field 1 2 field 1

    Day2 Workbook changes
    Master Sheet 2
    Equip # Location Equip # Location
    1 field 2 1 shop
    2 field 3 2 field 1
    1 field 2
    2 field 3

    The part I am struggling with is finding rows that appear in the master sheet but not anywhere in sheet 2. There are 6 columns in each row. I just need to be pointed in the right direction. Thank you.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Compare Sheets Find Missing Data

    It will be easy this way - everytime something changes in the master sheet, you clear the contents of sheet 2 and re-update.

    Will this work for you?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    11-01-2012
    Location
    Iowa
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Compare Sheets Find Missing Data

    Thank you for the quick reply however that will not work. I am not very good at explaining but the master list is use to be able to find where equipment is at any given time. The second sheet is used to keep track of where equipment has been so the records cannot be deleted.

    I think I could solve it I just don't know how to compare a row in the master sheet with all of the rows in the 2nd sheet regardless of order similar to ISERROR(MATCH(A1,$B:$B,0)) but with vba and all 6 columns.

    Maybe it can't be done.

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Compare Sheets Find Missing Data

    Hi SuperMan

    I have a sense of what your after but I'd like to see samples of your worksheets (Master and Sheet2). I'd think a Find based on Concatenation would work here.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  5. #5
    Registered User
    Join Date
    11-01-2012
    Location
    Iowa
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Compare Sheets Find Missing Data

    Sample.xlsx

    I should have done that right a way sorry. You would not have to compare every column only Job Assignment, Equip #, and Date Out are nessessary. I was originaly thinking of some sort of series of If statements but I am pretty new at this.

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Compare Sheets Find Missing Data

    Hi ClarkKent88

    Do you not have any code that does Find or Lookup in your current file? Do you not have any Drop Downs that allow you to select, for example Equip#?

    Is your Sample File a true representation of what you currently have? If it is we have a bit of a task ahead of us...not insurmountable...but more difficult and more coding required.

  7. #7
    Registered User
    Join Date
    11-01-2012
    Location
    Iowa
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Compare Sheets Find Missing Data

    Sample2.xlsm

    Again I'm sorry. I have attached a new sample. The data contains many entries in sortable tables and expands as tools are added I think it would be too large. I found a macro that finds matching rows I modified it to search the columns I need. Currently it just prints the rows that match.

  8. #8
    Registered User
    Join Date
    11-01-2012
    Location
    Iowa
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Compare Sheets Find Missing Data

    I think the following code is close. I think it finds unmatched rows but it copies and pastes every row instead of just the ones that don't match. If anyone has any ideas let me know.

    Please Login or Register  to view this content.

  9. #9
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Compare Sheets Find Missing Data

    Hi ClarkKent88

    Add two lines of code as indicated
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    11-01-2012
    Location
    Iowa
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Compare Sheets Find Missing Data

    Thank you all for your help I found a solution however it does not work in Excel 2003. If anyone knows off the top of their head why that would be great else I think I figure it out. Here is the code.

    HTML Code: 

  11. #11
    Registered User
    Join Date
    11-01-2012
    Location
    Iowa
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Compare Sheets Find Missing Data

    Thank you all for your help I found a solution however it does not work in Excel 2003. If anyone knows off the top of their head why that would be great else I think I figure it out. Here is the code.

    HTML Code: 

  12. #12
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Compare Sheets Find Missing Data

    Hi ClarkKent88

    Try this code...I've tested in both 2003 and 2007...let me know of issues
    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    11-01-2012
    Location
    Iowa
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Compare Sheets Find Missing Data

    That works great, Thank You.

  14. #14
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Compare Sheets Find Missing Data

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.

+ 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