팁 : 다른 언어는 Google 번역입니다. 방문하실 수 있습니다. English 이 링크의 버전.
로그인
x
or
x
x
회원가입
x

or

워크 시트 또는 통합 문서를 하나의 워크 시트로 병합 또는 통합하는 방법

Excel에서 복사 및 붙여 넣기 명령을 사용하면 많은 시간이 걸리는 데이터 분석을 위해 수백 개의 시트 또는 통합 문서를 하나의 시트로 병합하는 일상적인 작업에서 문제가 발생할 수 있습니다. 이 자습서에서는이 작업을 신속하게 해결하기위한 몇 가지 팁을 제공합니다.

doc 결합 1

QUICK NAVIGATION

활성 통합 문서의 모든 시트를 VBA와 함께 한 시트로 병합
수십 개의 시트 또는 워크 북을 하나의 워크 시트 / 워크 북에 병합
두 테이블을 하나로 병합하고 클릭으로 열을 업데이트
샘플 파일 다운로드


활성 통합 문서의 모든 시트를 VBA와 함께 한 시트로 병합

이 섹션에서는 활성 시트를 실행하는 동안 활성 시트의 모든 시트를 수집하는 새 시트를 만드는 VBA 코드를 제공합니다.

1. 전체 시트를 결합하려는 통합 문서를 활성화 한 다음를 누릅니다. + 열린 키 응용 프로그램 용 Microsoft Visual Basic 창.

2. 팝업 창에서 끼워 넣다 > 모듈 새 모듈 스크립트를 만들 수 있습니다.

3. 아래 코드를 복사하여 스크립트에 붙여 넣으십시오.

(1) .Activate Range ( "A1"). EntireRow.Select Selection (2) .Select Worksheets.Add Sheets (1) .Name = "결합 된"시트 (1). .Copy Destination : = Sheets (1) .Range ( "A2") J = 1 Sheets.Count Sheets (J) .Activate Range ( "A1") Select.CurrentRegion.Select Selection.Offset (0, 1)을 선택하십시오. ) .Resize (Selection.Rows.Count - 1) .Select Selection.Copy Destination : = Sheets (65536) .Range ( "A2") End (xlUp) (XNUMX) Next End Sub
doc 결합 2

4. 프레스 F5 키를 누르면 모든 시트의 모든 데이터가 Combined라는 새 시트에 병합됩니다.이 시트는 모든 시트의 앞에 배치됩니다.


오동작

가족과 동반 할 수있는 유급 휴가를 원하십니까?

Office Tab으로 Microsoft Office 50 %의 효율성 향상

믿을 수없는, 둘 이상의 문서에서 작업하는 것은 하나의 작업보다 쉽고 빠릅니다.

잘 알려진 브라우저와 비교할 때 Office 탭의 탭 도구는 더욱 강력하고 효율적입니다.

수백 번의 마우스 클릭 및 키보드 타이핑을 매일 줄이고 마우스의 손에 작별 인사를하십시오.

일반적으로 여러 문서에서 작업하는 경우 Office 탭을 사용하면 시간을 절약 할 수 있습니다.

30 일 무료 사용신용 카드가 필요하지 않습니다.

더 보기지금 무료 다운로드


수십 개의 시트 또는 워크 북을 하나의 워크 시트 / 워크 북에 병합

VBA를 사용하면 활성 통합 문서의 시트 만 결합 할 수 있지만 통합 문서의 시트를 시트 또는 통합 문서로 병합하려면 어떻게해야합니까?

통합 문서간에 시트를 한 시트로 병합
doc 결합 18

통합 문서간에 시트를 하나의 통합 문서로 병합
doc 결합 3

이 작업을 해결하고 시트 조합에 대한 다른 요구 사항을 충족 시키려면 결합 기능은 다음 4 가지 조합 시나리오로 개발되었습니다.

  • 여러 시트 또는 통합 문서를 하나의 시트로 결합
  • 여러 장 또는 통합 문서를 하나의 통합 문서로 결합
  • 동일한 이름표를 하나의 시트로 결합
  • 시트 또는 통합 문서의 값을 하나의 시트로 통합

두 번째 옵션을 인스턴스로 사용합니다.

여러 장 또는 통합 문서를 하나의 통합 문서로 결합

쥐새끼와 지금 자궁 경부 Spondylosis에 안녕을 말하십시오

Excel 용 Kutools의 300 고급 도구를 사용하면 몇 초 안에 80 % Excel 작업을 해결할 수 있으며 마우스 클릭 수천 회를 줄일 수 있습니다.

1500 작업 시나리오를 손쉽게 처리 할 수 ​​있으므로 솔루션 검색 시간을 낭비 할 필요가 없으며 인생을 즐기는 데 많은 시간을 할애 할 수 있습니다.

80 +의 생산성을 향상시켜줍니다.

더 이상 통증이없는 수식과 VBA로 괴로울 필요가 없으며, 당신의 두뇌에 휴식과 즐거운 일하는 기분을 선사하십시오.

모든 기능을 갖춘 30 일 무료 평가판, 이유없이 30 일 환불.

더 나은 몸은 더 나은 삶을 창조합니다.

Excel 용 Kutools를 무료로 설치 한 후에는 다음과 같이하십시오 :

1. Excel을 활성화하고를 클릭하십시오. Kutools 기타 > 결합, 닫을 필요가있는 통합 할 통합 문서를 알려주는 대화 상자가 나타납니다. 딸깍 하는 소리 OK 계속합니다.
doc 결합 4
doc 결합 5

2. 에서 워크 시트 결합 단계 1 대화 상자, 확인 통합 문서의 여러 워크 시트를 하나의 통합 문서로 결합 선택권. 딸깍 하는 소리 다음 것 마법사의 다음 단계로 이동합니다.
doc 결합 6

3. 클릭 추가 > 필렛 or 폴더 결합 할 통합 문서를 통합 문서 목록 창에서 이름을 확인하여 어떤 워크 시트가 함께 조인 될지 지정할 수 있습니다. 워크 시트 목록 창유리. 딸깍 하는 소리 다음 것 마법사의 마지막 단계로 이동합니다.
doc 결합 7

4. 이 단계에서 필요에 따라 설정을 지정하십시오. 그런 다음 .
doc 결합 8

5. 결합 된 통합 문서를 놓을 폴더를 선택하면 창이 열립니다. 저장.
doc 결합 9

이제 통합 문서가 하나의 통합 문서로 통합되었습니다. 또한 모든 시트의 앞면에 Excel 용 Kutools라는 마스터 시트가 만들어져 각 시트에 대한 시트 및 링크에 대한 정보가 나열됩니다.
doc 결합 10

데모 : 시트 / 통합 문서를 하나의 시트 또는 통합 문서로 결합

Excel 용 Kutools : 200 + 유용한 편리한 도구로 몇 번의 클릭만으로 Excel의 복잡한 작업을 단순화합니다.


두 테이블을 하나로 병합하고 클릭으로 열을 업데이트

두 개의 표를 하나로 병합하고 아래 스크린 샷과 같이 열을 기반으로 데이터를 업데이트하려는 경우 테이블 병합 ~의 유용성 Excel 용 Kutools.
doc 결합 11

Excel 용 Kutools : Excel에서 몇 번의 클릭으로 복잡한 작업을 단순화하는 200 편리한 Excel 추가 기능 이상

Excel 용 Kutools를 무료로 설치 한 후에는 다음과 같이하십시오 :

1. 클릭 Kutools 기타 > 테이블 병합 사용하려면 테이블 병합 마법사.
doc 결합 12

2. 마법사의 1 단계에서 메인 테이블과 룩업 테이블 범위를 별도로 선택해야합니다. 그런 다음 다음 것.
doc 결합 13

3. 기본 테이블의 데이터를 업데이트하려는 키 열을 확인하십시오. 딸깍 하는 소리 다음 것.
doc 결합 14

4. 그런 다음 조회 테이블을 기반으로 데이터를 업데이트하려는 주 테이블의 열을 확인하십시오. 딸깍 하는 소리 다음 것.
doc 결합 15

5. 마법사의 4 단계에서 조회 테이블에서 주 테이블로 추가 할 열을 선택하십시오. 딸깍 하는 소리 다음 것.
doc 결합 16

6. 마법사의 마지막 단계에서 필요에 따라 설정 옵션을 지정하십시오. 그런 다음 .
doc 결합 17

이제 주 테이블이 데이터를 업데이트하고 조회 테이블을 기반으로 새 데이터를 추가합니다.

데모 : 시트 / 통합 문서를 하나의 시트 또는 통합 문서로 결합

Excel 용 Kutools : 200 + 유용한 편리한 도구로 몇 번의 클릭만으로 Excel의 복잡한 작업을 단순화합니다.


샘플 파일 다운로드

견본


권장 생산성 도구

Office 탭 - 탭 브라우징, 편집, Microsoft Office의 문서 관리 2019 - 2003 및 Office 365


사무실 탭

Excel 2019-2007 가속화를위한 전문가 용 추가 기능으로 업무 시간을 몇 초로 줄여줍니다.

이 추가 기능에는 수십 개의 전문 그룹이 포함되어 있으며 300 + 옵션을 사용하면 Excel에서 일일 작업을 대부분 자동화하고 50 %만큼 생산성을 높일 수 있습니다. 원 클릭 옵슨 및 배치 전환과 같은 그룹.
이제 Excel 용 Kutools를 사용하여 자신감을 높일 수 있습니다.


Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Daniel · 2 months ago
    Hi,


    Great Code and for the most part it works fantastically well.


    Could I suggest creating a written tutorial for each line of code. I'd love to be able to play around with it to suit my Company's needs.

    In the meantime however could you talk me through problems that would hinder this code from copying all data from each Sheet? I've noticed some sheets in my workbook aren't being copied at all.

    To give you some context I'm dealing with roughly 330 sheets and they hold from 50 to 500 lines in each.


    looking forward to hearing from you.
    • To post as a guest, your comment is unpublished.
      Sunny · 1 months ago
      Hi, Daniel, I do not understand your question as you describe it not clearly, but if you have the Combine function in Excel, it can solve most of your question about combining sheets.
  • To post as a guest, your comment is unpublished.
    HS · 3 months ago
    Hi,

    Is it possible to only copy a particular range of cells for example A:4:FU38 from each sheet?


    Also in the Combined sheet where the data is copied to, can the tab names from where the data is copied included in column A to enable lookups or to pivot the data?


    Finally, can i specify the list of worksheets from which to copy the data across or maybe i can specify something like copy all worksheets to the left of a particular worksheet in the file.


    Thanks in advance for your help
  • To post as a guest, your comment is unpublished.
    Dennis · 4 months ago
    This VBA code is an absolute lifesaver. Thank you!!
  • To post as a guest, your comment is unpublished.
    martin o'reilly · 9 months ago
    Hi. This code works well but I have the same problem as adj. The 1st row form each tab doesn't appear in the combined tab - except he first tab. Thanks
    • To post as a guest, your comment is unpublished.
      Sunny · 9 months ago
      Yes, the code only can keep first row of the first tab, because it is used to consolidate, if you want to keep all contents of each sheet, you can try Combine utility of Kutools for Excel, it is free fior 60 days
  • To post as a guest, your comment is unpublished.
    elok · 10 months ago
    i had a problem when I try to combine all same name worksheet to one worksheet, it works but some value are missing. so what should i do?
    • To post as a guest, your comment is unpublished.
      Sunny · 9 months ago
      Hello, elok, did the problem appear while you applying Combine function? If so, please go to contact us support@extendoffice.com to describe the problem with more details, our support will handle the problem for you.
  • To post as a guest, your comment is unpublished.
    Andrew · 10 months ago
    Thanks that macro saved my day. I had over 40 sheets of data to combine into one and although my computer bogged for a minute or two, it completed without issue. The only modification I made was I tweaked the macro to start with A2 instead of A1 since A1 was my column headers.
    • To post as a guest, your comment is unpublished.
      Sunny · 10 months ago
      Thanks for your support, Andrew, I am glad that the macro can help you.
  • To post as a guest, your comment is unpublished.
    Thangaraj R · 11 months ago
    hi I would like combine all the worksheets in single sheet where i need data of column A of all worksheets and I need the worksheet names in column B
    • To post as a guest, your comment is unpublished.
      Sunny · 10 months ago
      Sorry, Thangaraj R, I do not undertsand your problem clearly, could you upload a screenshot to describe your quetion with more detials?
  • To post as a guest, your comment is unpublished.
    Gio · 11 months ago
    Hi all,
    I need to combine only sheets with identical heading, ship other sheets.


    thanks
  • To post as a guest, your comment is unpublished.
    arul kumar · 1 years ago
    Hi all,

    I have used the below mentioned code, In my data some blank Rows is there for each tab. Data is not coping after the blank rows. How to combine the all data after the blank rows. Please advise.

    Sub Combine()
    Dim J As Integer
    On Error Resume Next
    Sheets(1).Select
    Worksheets.Add
    Sheets(1).Name = "Combined"
    Sheets(2).Activate
    Range("A16").EntireRow.Select
    Selection.Copy Destination:=Sheets(1).Range("A1")
    For J = 2 To Sheets.Count
    Sheets(J).Activate
    Range("A17").Select
    Selection.CurrentRegion.Select
    Selection.Offset(1, 0).Resize(Selection.Rows.Count - 1).Select
    Selection.Copy Destination:=Sheets(1).Range("A65536").End(xlUp)(2)
    Next
    End Sub

    Thanks
    Arul
    • To post as a guest, your comment is unpublished.
      Sunny · 1 years ago
      You can try below code, it will merge all data and skip blank rows.

      Sub CombineForm()
      Dim xI, xMax As Integer
      Dim xCWS, xWS As Worksheet
      Dim xObjRRange, xObjCRange, xObjSR As Range
      On Error Resume Next
      Sheets(1).Select
      Set xCWS = Worksheets.Add
      xCWS.Name = "Combined"
      Sheets(2).Activate
      Range("A1").EntireRow.Select
      Selection.Copy Destination:=xCWS.Range("A1")
      For xI = 2 To Sheets.Count
      Set xWS = Sheets(xI)
      xWS.Activate
      Set xObjRRange = xWS.Cells.Find(What:="*", After:=[A1], SearchOrder:=xlByRows, SearchDirection:=xlPrevious)
      Set xObjCRange = xWS.Cells.Find(What:="*", After:=[A1], SearchOrder:=xlByColumns, SearchDirection:=xlPrevious)
      Set xObjSR = Range(Cells(1, 1), Cells(xObjRRange.Row, xObjCRange.Column))
      xObjSR.Select
      Selection.Copy Destination:=xCWS.Range("A65536").End(xlUp)(2)
      Next
      xMax = xCWS.Range("a65536").End(3).Row
      xCWS.Range("a1:a" & xMax).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
      End Sub
      • To post as a guest, your comment is unpublished.
        arul kumar · 1 years ago
        Thank you, Sunny! This coding is working fine..

        But i want to combine all the sheets from row no: 16. Could you help us to update the coding.

        Thanks
        Arul
        • To post as a guest, your comment is unpublished.
          Sunny · 1 years ago
          The below code will combine sheets from the second row, you can change the number 2 (xStart = 2) to other number for you need.

          Sub CombineForm()
          Dim xStart, xFNum, xIntCFMax, xIntRRg, xIntCRg As Integer
          Dim xCFWS, xWS As Worksheet
          Dim xObjSR As Range
          Dim xStrName As String
          On Error Resume Next
          Application.ScreenUpdating = False
          xStart = 2
          xStrName = "CombinedForm"
          Set xWS = Sheets(xStrName)
          If xWS Is Nothing Then
          xWS.Delete
          End If
          Set xCFWS = Worksheets.Add
          xCFWS.Name = xStrName

          For xFNum = 1 To Sheets.Count
          Set xWS = Sheets(xFNum)
          If xWS.Name <> xStrName Then
          xWS.Activate
          xIntRRg = xWS.Cells.Find(What:="*", After:=[A1], SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
          xIntCRg = xWS.Cells.Find(What:="*", After:=[A1], SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Column
          If xStart <= xIntRRg Then
          Set xObjSR = Range(Cells(xStart, 1), Cells(xIntRRg, xIntCRg))
          xObjSR.Select
          Selection.Copy Destination:=xCFWS.Range("A65536").End(xlUp)(2)
          End If
          End If
          Next
          Application.ScreenUpdating = True
          End Sub
      • To post as a guest, your comment is unpublished.
        arul · 1 years ago
        Thank you, Sunny!

        I want to combine the sheet from row no:16. Could you help me to update the coding.

        Thanks
        Arul
  • To post as a guest, your comment is unpublished.
    Neno · 1 years ago
    My headings start on row 26, the first 25 rows are occupied with the parameters I used to generate my reports, it would take a long time to delete these since there are many reports generated. Using the VBA code above, how could I configure this code to exclude the first 25 rows, capture the headings on row 26 and combine all the data under the headings (row 27 onwards) for each worksheet?
    • To post as a guest, your comment is unpublished.
      Bruno G. · 1 years ago
      Change all the "A1" in the code to "A26". Save your data before trying this change, just in case!
  • To post as a guest, your comment is unpublished.
    Tina · 1 years ago
    Hi.. The VBA code works fine. Thank you! But can you please help on how I can edit the code so that only 2 sheets will be combined? I have 5 sheets in my workbook but I only need to combine 2 of them.
    • To post as a guest, your comment is unpublished.
      Nigah · 1 years ago
      Just save as the current workbook with a new name and delete other three worksheets which you don't want to combine, now you have only your desired two sheets for VBA code execution.
  • To post as a guest, your comment is unpublished.
    deepak · 1 years ago
    hello everyone

    I want to merged more workbook data in one so give me suggest
  • To post as a guest, your comment is unpublished.
    oduff · 1 years ago
    Hi everyone,

    First of all I have to tell that I have no experience with Macro (VBA Codes). However what I need is related to this. Maybe you guys could help me with it.

    I have a workbook and in this workbook there are 10 worksheets. The first 9 Sheets have the same order of the coloumns of titles and in these columns there are names, dates, percentages of Project Status, comments to Projects etc.. As I said the columns have the same order just the name of the worksheets (for different Teams in the Organisation) are different.

    In Addition to this I have to merge all the worksheets and have them in another sheet which is called "Übersicht" (Overview). However there is a different column in the sheet and it's between "Nr." and "Thema" columns (which are in A1 and A2 in all the 9 Sheets) and this different column called "Kategorie" (in A2 in Übersicht-Overwiev sheet). As this column is between These the order is like this "Nr. (A1), Kategorie (A2) and Thema (A3).....".So this category column (Kategorie) should be empty except this all the Information should be merged into this sheet. And also when there is a Change or update in any worksheet, the Information in "Übersicht" (Overview) sheet needs to update by itself. How can I do this?

    P.S.: Every sheet has different filled rows, some 30, some 13, some 5 etc. And the Teams which are responsible for the Sheets can add or delete some rows (in each row there is different Information for different Projects). This also means the number of rows can increase or decrease.

    I hope I explained it well. Thanks a lot in advance!

    I wish you merry Christmas and a happy new year!

    oduff
  • To post as a guest, your comment is unpublished.
    hk · 1 years ago
    The VBA code works fine but I want the data to be merged horizontally(side by side).
    Hope you can help.
  • To post as a guest, your comment is unpublished.
    Jeanette · 1 years ago
    THANK YOU for the VB Code. Amazing. Worked perfectly. I had 72 worksheets to combine into one. It took a second and it was done. YOU ROCK.
  • To post as a guest, your comment is unpublished.
    Yohani · 2 years ago
    Excellent code! Worked very well!
  • To post as a guest, your comment is unpublished.
    Jonas · 2 years ago
    Hello!
    I need your support. I have three sheets (A, B, C) into a worksheet. the sheet contain information on individuals.
    Sheet A: contains all individuals considered as ID with information (age, education, etc...)
    Sheets B et C: contain some individuals (ID) with information (Organisation, income, etc...)
    So I want to combine B and C to A to get all information from A,B, C together.

    Jonas
  • To post as a guest, your comment is unpublished.
    Jennifer · 2 years ago
    Thank you so very much! The code worked perfectly! I appreciate the instruction so very much!!!
  • To post as a guest, your comment is unpublished.
    Gary · 2 years ago
    Hello, this worked fine at first, but now I see that not all rows from all worksheets are appended into the combined sheet. Please help!
  • To post as a guest, your comment is unpublished.
    Suzana · 2 years ago
    Oh dear! Thank you so MUCH. Worked PERFECTLY with the Code. Had trouble and was thinking how to resolve this and then...just in a second! Thank you a lot. God bless you!
  • To post as a guest, your comment is unpublished.
    adj · 2 years ago
    This code works for the most part - however, the first line of each sheet (except for the first sheet) is not extracted into the combined sheet. Which piece of the code should be modified to ensure extraction of the first line?
  • To post as a guest, your comment is unpublished.
    mario · 2 years ago
    You rock guys!
  • To post as a guest, your comment is unpublished.
    s · 2 years ago
    You guys are the best!!! You totally saved me and I look like a super star
  • To post as a guest, your comment is unpublished.
    Daniel · 2 years ago
    THANK YOU SO MUCH!!!!!
  • To post as a guest, your comment is unpublished.
    Mohd · 2 years ago
    How to merge multiple workbooks with multiple worksheets into one workbook?
  • To post as a guest, your comment is unpublished.
    Mohd · 2 years ago
    [quote name="John"], how to merge multiple workbooks with multiple worksheets into one workbook? appriciate if you could reply.
  • To post as a guest, your comment is unpublished.
    John · 2 years ago
    This is amazing. Thank you so much!
  • To post as a guest, your comment is unpublished.
    Jens · 2 years ago
    When installed, Excel 365 gives a memory error and nothing works.
    I had to uninstall kutools to be able to work again :-(
  • To post as a guest, your comment is unpublished.
    Rich Thorpe · 2 years ago
    Thanks for the help on combining worksheets. Saved me hours of mind numbing work!
  • To post as a guest, your comment is unpublished.
    Ryan · 2 years ago
    how do i get the macro to insert column "a" and paste the name of the workbook the data came from in the added column
  • To post as a guest, your comment is unpublished.
    astu · 2 years ago
    it works so well for my case.
    million thanks for sharing!!!!
  • To post as a guest, your comment is unpublished.
    Raymundo · 2 years ago
    It works, Thaaaanks!
  • To post as a guest, your comment is unpublished.
    Charul · 2 years ago
    can you please explain me the meaning of [b]Selection.Copy Destination:=Sheets(1).Range(" A65536").End(xlUp)(2)[/b] line?What is A65536 used for?
  • To post as a guest, your comment is unpublished.
    Yogesh · 2 years ago
    How to overwrite the updated data over existing data
  • To post as a guest, your comment is unpublished.
    Diane · 2 years ago
    Attempted VBA Code. Have 5 worksheets in 2 workbook that need to be combined. All same structure. VBA code will only combine 2 of the worksheets rather than all 5. What do I change in the VBA code to make combine all 5 worksheets? Data in worksheets is all under the 65K .xls row limit and I am using Excel 2016.
  • To post as a guest, your comment is unpublished.
    Elvedin · 2 years ago
    I receive spreadsheets where table header is in starts in row 3. So I need to go to each worksheet to delete columns 1 and 2 for the macro to work. Can I adjust the code, so it would start in A3 instead of A1
  • To post as a guest, your comment is unpublished.
    boopathi raj · 2 years ago
    Very much Thanks ... ... :lol:
  • To post as a guest, your comment is unpublished.
    CRG · 2 years ago
    [quote name="Nat"]When using the VBA providied above, is there a way for the combined sheet to automatically update when the sheets that is combined are added to it, so it is always running?

    Thanks![/quote]
    Would like to know the answer to this. Thanks for the great Macro!
  • To post as a guest, your comment is unpublished.
    angry_banana · 2 years ago
    Hi! Can you help me with this problem.
    I have an excel doc with 12 sheets. In each sheet is a table. With a differend cells format (width & height).
    I have to copy all sheets in one and save each cells format. Thanks!
  • To post as a guest, your comment is unpublished.
    Kayla · 2 years ago
    Your macro worked BUT it added each sheet multiple times. i have no idea why...I had 4 sheets with invoice lists (1 septembers, 2 octobers Ect.)
    and for some reason it added my september back on 2 more times and added eachother one underneath 3x each....
    I did not modify or delete anything from the macro just simply copied pasted and ran it...
  • To post as a guest, your comment is unpublished.
    GeneA · 2 years ago
    For those people who want to update data they already merged you can use this code:

    Sub Combine()
    Dim J As Integer
    On Error Resume Next
    'Delete the sheet "Combined" if it exist
    Application.DisplayAlerts = False
    On Error Resume Next
    ActiveWorkbook.Worksheets("Combined").Delete
    On Error GoTo 0
    Application.DisplayAlerts = True

    Sheets(1).Select
    Worksheets.Add
    Sheets(1).Name = "Combined"
    Sheets(2).Activate
    Range("A1").EntireRow.Select
    Selection.Copy Destination:=Sheets(1).Range("A1")
    For J = 2 To Sheets.Count
    Sheets(J).Activate
    Range("A1").Select
    Selection.CurrentRegion.Select
    Selection.Offset(1, 0).Resize(Selection.Rows.Count - 1).Select
    Selection.Copy Destination:=Sheets(1).Range("A65536").End(xlUp)(2)
    Next
    End Sub


    ----------------------------------

    Hope that helps!!!!
  • To post as a guest, your comment is unpublished.
    Kabir Humayun · 2 years ago
    How can i collect specific cells data from around 400 sheet... where all sheet are same format.

    for ex. I want to get data from A3, A4, A29, B30, C34 and store on a new sheet.

    thanks in advanced.
  • To post as a guest, your comment is unpublished.
    Kabir Humayun · 2 years ago
    1st thanks for the code,
    I modified the code following way,
    Sub Combine()
    Dim J As Integer
    On Error Resume Next
    Sheets(1).Select
    Worksheets.Add
    Sheets(1).Name = "Combined"
    Sheets(2).Activate
    Range("A1").EntireRow.Select
    Selection.Copy Destination:=Sheets(1).Range("A1")
    For J = 2 To Sheets.Count
    Sheets(J).Activate
    Range("A1").Select
    Selection.CurrentRegion.Select
    Selection.Offset(0, 0).Resize(Selection.Rows.Count - 1).Select
    Selection.Copy Destination:=Sheets(1).Range("A65536").End(xlUp)(2)
    Sheets(J).Activate
    Range("A1").Select
    Selection.CurrentRegion.Select
    Selection.Offset(3, 0).Resize(Selection.Rows.Count - 1).Select
    Selection.Copy Destination:=Sheets(1).Range("B65536").End(xlUp)(2)
    Sheets(J).Activate
    Range("A1").Select
    Selection.CurrentRegion.Select
    Selection.Offset(115, 5).Resize(Selection.Rows.Count - 1).Select
    Selection.Copy Destination:=Sheets(1).Range("E65536").End(xlUp)(2)
    Sheets(J).Activate
    Range("A1").Select
    Selection.CurrentRegion.Select
    Selection.Offset(116, 5).Resize(Selection.Rows.Count - 1).Select
    Selection.Copy Destination:=Sheets(1).Range("F65536").End(xlUp)(2)

    Next
    End Sub

    When i tried with this code only around 5/10 sheet, it works fine, but when i tried this code for around 400 sheets then got 2 wrong value and after 255 row no data come for only one column.

    Another columns data are okey and came.

    any idea, basically i need to call data (from some specific cell) from around 400 sheets any idea ?
  • To post as a guest, your comment is unpublished.
    Chandra Mouli · 2 years ago
    Excellent Job ....buddy u have refine my 1 hour ....
    THANKS
  • To post as a guest, your comment is unpublished.
    Martin · 2 years ago
    When I try to use this VBA, it caps out at 79,160 lines (including header). Any suggestions on how to tweak the code or could it be the data in the spreadsheets.
  • To post as a guest, your comment is unpublished.
    Lloyd · 2 years ago
    I am using the VBA below with great effect with all the sheets in workbook but now I am trying to exclude one sheet name " OAL Index" and just cant seemed to get it right. It keeps selecting all the sheets

    Any points to the right direction would be appreciated.

    Sub Combine()
    Dim J As Integer

    On Error Resume Next
    Sheets(1).Select
    Worksheets.Add ' add a sheet in first place
    Sheets(1).Name = "Combined"

    ' copy headings
    Sheets(2).Activate
    Range("A2").EntireRow.Select
    Selection.Copy Destination:=Sheets(1).Range("A2")

    ' work through sheets

    For J = 2 To Sheets.Count ' from sheet 2 to last sheet
    If Sheets(J).Name "OAL Index" Then Sheets(J).Select Replace:=False
    Sheets(J).Activate ' make the sheet active
    Sheets(J).Select
    Range("A1").Select
    Selection.CurrentRegion.Select ' select all cells in this sheets

    ' select all lines except title
    Selection.Offset(2, 0).Resize(Selection.Rows.Count - 1).Select

    ' copy cells selected in the new sheet on last line
    Selection.Copy Destination:=Sheets(1).Range("A65536").End(xlUp)(2)
    Next
    End Sub



    Thanks All
  • To post as a guest, your comment is unpublished.
    Jennifer · 2 years ago
    This worked great, saved me a lot of time, but it only merged up to column J and I need it to go up to column T. Can someone please help??? This is for my job!!
    Please help me not look dumb in front of my boss, thanks
  • To post as a guest, your comment is unpublished.
    VJ · 3 years ago
    How can I modify the code to paste as value only?
  • To post as a guest, your comment is unpublished.
    Mike · 3 years ago
    This isn't a merge...it's simply stacking data. Change the title, please.
  • To post as a guest, your comment is unpublished.
    Maher · 3 years ago
    Thank, I used Kutools, it is so easy to use. Thanks again!