+ Reply to Thread
Results 1 to 9 of 9

Comparing two excel files and copy Unmatched

  1. #1
    Registered User
    Join Date
    01-08-2013
    Location
    Hungary
    MS-Off Ver
    Excel 2010
    Posts
    11

    Comparing two excel files and copy Unmatched

    Hello!

    I am a newbie here and in VBA.

    I have two excel files a "weekly" WB and a report with "main data" WB.

    I need to compare "weekly" WB "Raw data" sheet Column A with "main data" WB "report" sheet Column E (starting from E6). If the data matching then I need to copy from "weekly" report "Raw data" sheet D column data (where the compared cells are matching) to "main data" WB "report" sheet column D.

    Also if there are unmatched data then unmatched data needs to copy to the end of "main data" WB "report" sheet.

    Any help would be appreciated!

    Thanks!

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Comparing two excel files and copy Unmatched

    Welcome to the Forum Peter. Can you attach a sample file with some dummie data to test on? To attach a file, push the button with the paperclip (or scroll down to the Manage Attachments button), browse to the required file, and then push the Upload button.

  3. #3
    Registered User
    Join Date
    01-08-2013
    Location
    Hungary
    MS-Off Ver
    Excel 2010
    Posts
    11

    Thumbs up Re: Comparing two excel files and copy Unmatched

    Hi John!

    Thank you for the greetings! http://www.excelforum.com/images/icons/icon14.png

    I have figured out the main part of the code. I have looked after on many forums and with a "little" assistance I have created the following code:

    Please Login or Register  to view this content.
    Only one task remained but first I try to figure out then ask questions
    Last edited by peter.hernadi; 08-27-2013 at 02:53 AM.

  4. #4
    Registered User
    Join Date
    01-08-2013
    Location
    Hungary
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Comparing two excel files and copy Unmatched

    While I am searching the next task would be -

    If Column 'A' in "workbook name" "report" sheet contains :
    • eoi then the data in column D (in the same row) will be 'FMO'
    • SW then the data in column D (in the same row) will be 'CMO'

    and this action is in loop until it reaches the last row. Maybe I can build it into the original code but maybe it would be better put in a separate sub.

    sample.jpg

    thanks in advance!
    Last edited by peter.hernadi; 08-27-2013 at 02:53 AM.

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Comparing two excel files and copy Unmatched

    Peter, though I think it would be best to attach an actual workbook with sample data. Maybe this?

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    01-08-2013
    Location
    Hungary
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Comparing two excel files and copy Unmatched

    Yes, it would be easier, but I needed to create a spreadsheet with sample data.

    It is attached now and thank you!

    Sample_CMO-FMO.xlsx

  7. #7
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Comparing two excel files and copy Unmatched

    Does this help?

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    01-08-2013
    Location
    Hungary
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Comparing two excel files and copy Unmatched

    It works!

    Thank you John!!

  9. #9
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Comparing two excel files and copy Unmatched

    You're welcome. Glad to help out and thanks for the feedback. Please comply with Forum Rule No. 9.

    9. Acknowledge the responses you receive, good or bad. If your problem is solved, please say so clearly, and mark your thread as Solved: Click Thread Tools above your first post, select "Mark your thread as Solved". Or click the Edit button on your first post in the thread, Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Dropdown option or Edit button will not appear -- ask a moderator to mark it.

+ 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] Comparing two worksheets and highlight unmatched Data
    By vignesh rocks in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-27-2012, 03:45 PM
  2. Comparing two sheets and highlight unmatched data
    By vignesh rocks in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-17-2012, 02:05 PM
  3. Compare sheets and copy unmatched cells
    By praetorianprefect in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-29-2011, 01:03 AM
  4. Compare 2 sheets & copy unmatched data below
    By tek9step in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-27-2010, 10:57 AM
  5. VBA - Compare one column in two sheets & copy unmatched to one sheet
    By TreasureCat in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-19-2007, 11:18 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