+ Reply to Thread
Results 1 to 5 of 5

Compare Columns A& B on Sheets M and D, if A matches and B doesnt Copy B, else new row

  1. #1
    Registered User
    Join Date
    10-14-2011
    Location
    chesapeake, va
    MS-Off Ver
    Excel 2007
    Posts
    59

    Compare Columns A& B on Sheets M and D, if A matches and B doesnt Copy B, else new row

    Thanks for stopping by first of all. so I'll try to be Clear. I'm certain its simple for someone, but definitely kicking my butt this week.

    I would like to compare 2 columns A and B in sheets Master(M) and Data(D), if the data matches in A, Check B, if B matches, go to Next. If Not, update Master(M) B with the values from Data(D) B, but if the values from Data(D) don't match in A or B, Add a new row to Master(M) from the unmatched row.

    so Master(M) holds all the info, if Data(D) has a new listing in column A, add a Row in Master(M) with A and B from data, otherwise just Update B in Master(M) from Data(D)
    Last edited by Spyderz; 10-12-2012 at 05:58 PM. Reason: Solved Thank Rylo!

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Compare Columns A& B on Sheets M and D, if A matches and B doesnt Copy B, else new row

    Hi

    Try this

    Please Login or Register  to view this content.
    rylo

  3. #3
    Registered User
    Join Date
    10-14-2011
    Location
    chesapeake, va
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re: Compare Columns A& B on Sheets M and D, if A matches and B doesnt Copy B, else new row

    Thank you so much for the quick response. The code worked just the way i had asked as well. after using i realized the error in my ways. How could we manipulate the code to only look at A3 at the starting point on Master, and A1 on Data? i attempted A3:A as MasSH but it definitely didn't like that at all

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Compare Columns A& B on Sheets M and D, if A matches and B doesnt Copy B, else new row

    Hi

    Just change the 2 to 1 in the for loop. This loop works on the data sheet. Is there anything in A1:A2 of the master sheet that could be confused with anything from the data sheet? If so, then would it be a partial match or a complete match to the entry?

    rylo

  5. #5
    Registered User
    Join Date
    10-14-2011
    Location
    chesapeake, va
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re: Compare Columns A& B on Sheets M and D, if A matches and B doesnt Copy B, else new row

    I wound up altering other macros to temporally add the rows missing.. fortunately A1:A2 aren't confused with anything from the data sheet. Those are my header and statistics row. I do appreciate your help. that code helped me to move along at a pretty good pace on my crazy little project. Thanks again!
    Last edited by Spyderz; 10-12-2012 at 08:59 PM. Reason: *Grammer Correction

+ 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