Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6921319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:15:43+00:00 2026-05-27T10:15:43+00:00

I have two excel sheets. I have to merge the two such that the

  • 0

I have two excel sheets. I have to merge the two such that the values in one match with the other. For eg.

The first excel,    the 2nd excel

1  t                 1   tes1
2  5                 3   tes3
3  t                 4   tes4
4  g

Notice that in the first column of the 2nd excel, 2 is missing, so I want the first excel to look like this,

1 tes1 t
2      5 
3 tes3 t
4 tes4 g

I am new to excel. Any help on this will be highly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:15:44+00:00Added an answer on May 27, 2026 at 10:15 am
    Sub left_join()
    Dim res As Variant
    Dim i As Long, lastUsedRowSh1 As Long, lastUsedRowSh2 As Long
    Dim cell As Range
    Sheets(3).Cells.ClearContents
    Sheets(1).Range("a:b").Copy Destination:=Sheets(3).Range("a1")
    Sheets(3).Columns(2).Insert Shift:=xlToRight
    lastUsedRowSh1 = Sheets(1).Cells(ActiveSheet.Rows.Count, "A").End(xlUp).Row
    lastUsedRowSh2 = Sheets(2).Cells(ActiveSheet.Rows.Count, "A").End(xlUp).Row
    i = 1
    For Each cell In Sheets(1).Range("a1:a" & lastUsedRowSh1)
        On Error Resume Next
        res = Application.WorksheetFunction.VLookup(cell.Value, Sheets(2).Range("a1:b" & lastUsedRowSh2), 2, 0)
            If Err.Number = 0 Then
                Sheets(3).Range("b" & i).Value = res
                i = i + 1
            Else
                i = i + 1
            End If
    Next cell
    End Sub
    

    You can even solve with a simple formula.

    Foglio1

    A   B
    1   t
    2   5
    3   t
    4   g
    

    Foglio2

    A   B
    1   tes1
    3   tes3
    4   tes4
    

    Foglio3

    Copy the content of Foglio1 in Foglio3, then run this formula

    =IF(ISERROR(VLOOKUP(Foglio1!A1,Foglio2!$A$1:$B$3,2,0))=TRUE,"",VLOOKUP(Foglio1!A1,Foglio2!$A$1:$B$3,2,0))
    

    and drag it down. Regards.

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one Excel document with two sheets Sheet1 and Sheet2. Sheet1 data is
I have a excel workbook with two sheets. One sheet is maxed out and
I have an Excel sheet with two column, one is a number , and
I have an excel spreadsheet with two columns, one with a list of exercises
I have an excel spreadsheet that has two columns. When I choose to save
I have an excel file (that I use as a template) with two rows.
I have an Excel document with 10000 rows of data in two sheets, the
I have two Excel sheets of climate data: temperature (dtT) and relative humidity (dtR).
i have two excel sheets An example of the two sheets are below sheet1
currently, I am struggeling with the following: I have two Excel files. One files

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.