How to add excel sheet into one file?

Nvr

New Member
Joined
Mar 13, 2020
Messages
4
Office Version
  1. 365
I having two Excel Workbook (excel file) with one sheet for each.
I want to add both sheet into one excel file (as 1 workbook with 2 excel sheet )

How to do that.
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
  1. Right click on the worksheet tab and select Move or Copy.
  2. Select the Create a copy checkbox.
  3. Under Before sheet, select where you want to place the copy.
  4. Select OK.
 
  • Like
Reactions: Nvr
Upvote 0
  1. Right click on the worksheet tab and select Move or Copy.
  2. Select the Create a copy checkbox.
  3. Under Before sheet, select where you want to place the copy.
  4. Select OK.
How to join both sheet in new workbook?
I know there is option under that, but i cannot choose both excel workbook
 
Upvote 0
Use the below macro. Is working fine by me. Source is here: Combining Worksheets from Many Workbooks (Microsoft Excel)

VBA Code:
Sub OneSheetFromMultipleWB()

    Dim sPath As String

    Dim sFname As String

    Dim wBk As Workbook

    Dim wSht As Variant

    Application.EnableEvents = False

    Application.ScreenUpdating = False

    sPath = InputBox("Enter a full path to workbooks")

    ChDir sPath

    sFname = InputBox("Enter a filename pattern")

    sFname = Dir(sPath & "\" & sFname & ".xl*", vbNormal)

    wSht = InputBox("Enter a worksheet name to copy")

    Do Until sFname = ""

        Set wBk = Workbooks.Open(sFname)

        Windows(sFname).Activate

        Sheets(wSht).Copy Before:=ThisWorkbook.Sheets(1)

        wBk.Close False

        sFname = Dir()

    Loop

    ActiveWorkbook.Save

    Application.EnableEvents = True

    Application.ScreenUpdating = True

End Sub
 
Upvote 0
T
Use the below macro. Is working fine by me. Source is here: Combining Worksheets from Many Workbooks (Microsoft Excel)

VBA Code:
Sub OneSheetFromMultipleWB()

    Dim sPath As String

    Dim sFname As String

    Dim wBk As Workbook

    Dim wSht As Variant

    Application.EnableEvents = False

    Application.ScreenUpdating = False

    sPath = InputBox("Enter a full path to workbooks")

    ChDir sPath

    sFname = InputBox("Enter a filename pattern")

    sFname = Dir(sPath & "\" & sFname & ".xl*", vbNormal)

    wSht = InputBox("Enter a worksheet name to copy")

    Do Until sFname = ""

        Set wBk = Workbooks.Open(sFname)

        Windows(sFname).Activate

        Sheets(wSht).Copy Before:=ThisWorkbook.Sheets(1)

        wBk.Close False

        sFname = Dir()

    Loop

    ActiveWorkbook.Save

    Application.EnableEvents = True

    Application.ScreenUpdating = True

End Sub
Thanks
 
Upvote 0

Forum statistics

Threads
1,223,943
Messages
6,175,551
Members
452,652
Latest member
eduedu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top