+ Reply to Thread
Results 1 to 11 of 11

Comparing 2 worksheets

  1. #1
    Registered User
    Join Date
    07-03-2012
    Location
    Cebu, Philippines
    MS-Off Ver
    Excel 2003
    Posts
    10

    Comparing 2 worksheets

    Dear all,

    I have 2 worksheets from 2 different companies with several columns of data. To demonstrate, i've attached a sample file. Sheet 1 and sheet 2 are the worksheets from both companies. From the 2 worksheets, only 1 column contains figures that are common to both, column D on sheet 1 and column A on sheet 2. What I wanted to accomplish was something as shown on sheet 3.

    If the "amount" column were all unique, I would be able to do this, but since there are multiple entries with the same value, I don't know what to do anymore :D My failed try is on sheet 4 :D

    Hope someone could help me, don't even know if what I need is possible at all

    TIA!
    Attached Files Attached Files
    Last edited by KristieKMD; 07-05-2012 at 08:33 AM.

  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: Comparing 2 worksheets

    You are right, having just the amount field as the common field between the sheets wont help. This is going to make it tough to actually compare the sheets.
    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
    07-03-2012
    Location
    Cebu, Philippines
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Comparing 2 worksheets

    Hi Arlette, thanks for the reply.

    I suspected that much, just figured i'd give it a try I thought there was a way to eliminate a value (or an entire row) from being "re-matched" once it has already been matched previously.

  4. #4
    Registered User
    Join Date
    07-03-2012
    Location
    Cebu, Philippines
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Comparing 2 worksheets

    Hi again everyone.

    Have an update on my problem. Was able to ask both companies to add a column that would be common to both worksheets, and that's a 16-digit ID. Company B (sheet 2) can give me the 16-digit ID, however, Company A (sheet 1) can only give me the first 6 digits and last 4 digits of the ID, and in the middle are hidden values represented by the letter X. Example: in sheet 2, I can find a value like 3541233425435421 but then on sheet 1, the equivalent row will show 354123XXXXXX5421. Is it possible to make a match using the first 6 digits of that ID no? Or the last 4 digits? Or both?

    TIA!

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

    Re: Comparing 2 worksheets

    Yes its possible. Why dont you attach a sample file with this field?

  6. #6
    Registered User
    Join Date
    07-03-2012
    Location
    Cebu, Philippines
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Comparing 2 worksheets

    Wow, that was quick, thanks Arlette

    Here's a sample worksheet. As before, Sheet 3 is the result I want and sheet 4 is my failed try

    Sample 2.xlsx

  7. #7
    Registered User
    Join Date
    07-03-2012
    Location
    Cebu, Philippines
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Comparing 2 worksheets

    Also, if possible at all, using both (first 6 and last 4) would be ideal... in the slightest chance that there could be a matching first 6 ID nos., or the same last 4 ID nos. I don't think there would be entries with same values on both ends.

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

    Re: Comparing 2 worksheets

    Try this code
    Please Login or Register  to view this content.
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

    To run the Excel VBA code:
    Choose Tools | Macro | Macros
    Select a macro in the list, and click the Run button
    Last edited by arlu1201; 07-05-2012 at 08:19 AM.

  9. #9
    Registered User
    Join Date
    07-03-2012
    Location
    Cebu, Philippines
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Comparing 2 worksheets

    Wow, thank you Arlette, I expected a line, turned out to be a lot of codes, seemed like a lot of work. It works, thank you thank you thank you for taking the time

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

    Re: Comparing 2 worksheets

    You are welcome. Not a lot of work if you have the logic straight

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  11. #11
    Registered User
    Join Date
    07-03-2012
    Location
    Cebu, Philippines
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Comparing 2 worksheets

    Done, changed to solved.

    Thanks again!!!

+ 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