+ Reply to Thread
Results 1 to 6 of 6

Compare two lists in Sheet 1 & 2 Column A, then combine the match adjacent cells in sheet3

Hybrid View

  1. #1
    Registered User
    Join Date
    09-19-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    13

    Compare two lists in Sheet 1 & 2 Column A, then combine the match adjacent cells in sheet3

    Hello,

    I have two lists of information, each list is a different length and only one column will have matches (column A). I have a list in sheet 2 and need to find the matching results in sheet 1 and then combine the adjacent information from sheet 2 and sheet 1 into sheet 3.

    I have searched everywhere for something close to what I require, but can't seem to find anything that works. I have written some code but it only returns one result.
    Sub search()
    
    Dim srch
    
    For srch = 1 To Range("A" & Rows.Count).End(xlUp).Row
        If Sheets("Sheet2").Cells(srch) = Sheets("Sheet1").Cells(srch) Then
                    Sheets("Sheet3").Cells(, "a") = Sheets("Sheet2").Cells(srch, "a")
                    Sheets("Sheet3").Cells(, "b") = Sheets("Sheet2").Cells(srch, "b")
                    Sheets("Sheet3").Cells(, "c") = Sheets("Sheet2").Cells(srch, "c")
                    Sheets("Sheet3").Cells(, "d") = Sheets("Sheet2").Cells(srch, "d")
                    Sheets("Sheet3").Cells(, "e") = Sheets("Sheet2").Cells(srch, "e")
                    Sheets("Sheet3").Cells(, "f") = Sheets("Sheet1").Cells(srch, "a")
                    Sheets("Sheet3").Cells(, "g") = Sheets("Sheet1").Cells(srch, "b")
                    Sheets("Sheet3").Cells(, "h") = Sheets("Sheet1").Cells(srch, "c")
                    Sheets("Sheet3").Cells(, "i") = Sheets("Sheet1").Cells(srch, "d")
        End If
    
     Next
    
    End Sub
    Can anyone help me please, even point me in the right direction and I can change the code to fit my needs.

    Thank you for any help in advanced.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Compare two lists in Sheet 1 & 2 Column A, then combine the match adjacent cells in sh

    Raulos,
    Please attach a sample with a desired result.

  3. #3
    Registered User
    Join Date
    09-19-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Compare two lists in Sheet 1 & 2 Column A, then combine the match adjacent cells in sh

    Thanks AB33, I have attached an example, with how I want the result on sheet 3.

    Example.xlsx

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Compare two lists in Sheet 1 & 2 Column A, then combine the match adjacent cells in sh

    Try the attached.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-19-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Compare two lists in Sheet 1 & 2 Column A, then combine the match adjacent cells in sh

    AB33, thank you so much! It worked perfectly, I really appreciate your help.

    Paul

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Compare two lists in Sheet 1 & 2 Column A, then combine the match adjacent cells in sh

    Paul,
    You are welcome!

+ 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