HELP: Compile Sheets Into ONE Tab

sungersoo

New Member
Joined
Nov 9, 2017
Messages
34
VBA: Compile 5 out of 10 sheets into 1

Hello!

I have made a macro to basically take 5 data sources and order them into new order by headers. Now I have 5 sheets into a workbook of 10 that is set in the same order with same headers.

Is there a macro out here that would compile the 5 sheets (with same headers) into one sheet? I have tried several online but due to the lines not being static, it would not work.

Thank you very much in advance!
 
In that case it sounds like you might have one or more cells that contain a space or some other non-visible character, in the first blank row (probably in col A).
Another possibility, do you have any formulas that return ""
 
Upvote 0

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
I think it might have something to do with the table, but try this
Code:
Sub chk()
Application.ScreenUpdating = False
Dim ws As Worksheet
   Sheets("Import").UsedRange.Cells.Copy Sheets("Combined").Cells(1, 1)
   For Each ws In Sheets(Array("HG Import", "HG Import2", "Moose Import", "CSFE", "Untracked2"))
      With ws.UsedRange
         If .Rows.Count > 1 Then
            .Offset(1, 0).Resize(.Rows.Count - 1).Copy Sheets("Combined").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
         End If
      End With
   Next ws
   Application.ScreenUpdating = True
End Sub
 
Upvote 0
Re: VBA: Compile 5 out of 10 sheets into 1

Try:
Code:
Sub Compile()
' Keyboard Shortcut: Ctrl+Shift+E
    Application.ScreenUpdating = False
    Dim x As Long
    x = 2
    Dim ws As Worksheet
    Sheets("Import").UsedRange.Cells.Copy Sheets("Combined").Cells(1, 1)
    For Each ws In Sheets(Array("HG Import", "HG Import2", "Moose Import", "CSFE", "Untracked2"))
        ws.UsedRange.Offset(1, 0).Copy Sheets("Combined").Cells(x, 1)
        x = x + 1
    Next ws
    Application.ScreenUpdating = True
End Sub
 
Upvote 0
Re: VBA: Compile 5 out of 10 sheets into 1

sungersoo: You have had two threads running on essentially the same topic, wasting the time of people who are subscribed to one thread and not the other.

Kindly read Mr Excel's policy in Rule 12 against asking questions about the same topic in multiple threads: http://www.mrexcel.com/forum/board-announcements/99490-forum-rules.html
I have now merged the two threads.
 
Upvote 0
Re: VBA: Compile 5 out of 10 sheets into 1

Please ignore the macro I suggested in Post #26 . Start with a blank "Combined" sheet and the original macro works properly.
Code:
Sub Compile()
' Keyboard Shortcut: Ctrl+Shift+E
    Application.ScreenUpdating = False
    Dim ws As Worksheet
    Sheets("Import").UsedRange.Cells.Copy Sheets("Combined").Cells(1, 1)
    For Each ws In Sheets(Array("HG Import", "HG Import2", "Moose Import", "CSFE", "Untracked2"))
        ws.UsedRange.Offset(1, 0).Copy Sheets("Combined").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
    Next ws
    Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,290
Messages
6,124,091
Members
449,142
Latest member
championbowler

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