Combine Multiple Sheets

rjbinney

Active Member
Joined
Dec 20, 2010
Messages
304
Office Version
  1. 365
Platform
  1. Windows
Hey, Mr. Excel!

I have multiple tabs in one workbook, need to get them all in one. All columns are titled the same. Data on each tab is Formatted As Table.

My Googling keeps returning two options - "Consolidate" function, but I just want everything to pop into one tab. I don't want to SUM, VAR, or nothin'. Other option is Get Data/Power Query, which no matter what I do, turns everything into a muskrat's ********.

Help would be groovy. And helpful!

Love,
 
You could give this macro a try with a copy of your workbook.
It assumes there is a Table (ListObject) on each worksheet.

VBA Code:
Sub Combine_Tables()
  Dim wsS As Worksheet
  Dim i As Long, nr As Long
  
  On Error Resume Next
  Set wsS = Sheets("Summary")
  On Error GoTo 0
  If wsS Is Nothing Then
    Sheets.Add.Name = "Summary"
    Set wsS = Sheets("Summary")
  End If
  With wsS
    .Move After:=Sheets(Sheets.Count)
    .UsedRange.Clear
    Sheets(1).ListObjects(1).Range.Rows(1).Copy
    .Range("A1").PasteSpecial xlPasteValues
    For i = 1 To Sheets.Count - 1
      nr = .Cells.Find(What:="*", LookIn:=xlValues, SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row + 1
      Sheets(i).ListObjects(1).DataBodyRange.Copy
      .Range("A" & nr).PasteSpecial xlPasteValues
    Next i
    .ListObjects.Add xlSrcRange, .UsedRange, , xlYes
  End With
End Sub
 
Upvote 0

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