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!
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Re: VBA: Compile 5 out of 10 sheets into 1

Are there any blank rows between your headers in row 1 and the first row of your data?
 
Upvote 0
Re: VBA: Compile 5 out of 10 sheets into 1

In that case I don't know why you're getting a blank row. It is always easier to help and test possible solutions if we could work with your actual file. Perhaps you could upload a copy of your file to a free site such as www.box.com. or www.dropbox.com. Once you do that, mark it for 'Sharing' and you will be given a link to the file that you can post here. If the workbook contains confidential information, you could replace it with generic data.
 
Upvote 0
Hello,

I am having trouble with a macro that compiles several sheets into one tab. The issue is after each sheet is compiled, there is a row added for each sheet.

Can anyone help with this macro?

Thank you!

Code:
    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
 
Upvote 0
@Fluff

I.E

Sheet 1 has 4 row totals and Sheet 2 also has 4 rows total.

In the compiled sheet, It would add another row which would make it 10 rows total.
 
Upvote 0
Are you getting blank rows between each sheet, on the compiled sheet?
 
Upvote 0
I just set up a real simple example that your code would work against, and I am not getting any blank rows.
Usually, that indicates that you have a row at the end of your data that is blank, but might have some formatting or something to that effect, so that it thinks that is really the last row.

Go to the offending sheets, and hit CTRL-END and see where the cursor goes.
Does it go to the last row, or one row past what you think is the last row?
Inspect that row for anything funny. Then try deleting it and see if that resolves it.
 
Upvote 0

Forum statistics

Threads
1,215,325
Messages
6,124,252
Members
449,149
Latest member
mwdbActuary

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