Merge Worksheets to

smk81

New Member
Joined
Jun 9, 2014
Messages
16
I would like to merge 5 (worksheets are named Ohio, Kentucky, Indiana, Michigan, & Pennsylvania) worksheets into a "Master" worksheet. Each of the 5 worksheets I wish to merge have the same column headings. Is there a simple VBA solution I can use? Thanks for any and all help!
 

Some videos you may like

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

onlyadrafter

Well-known Member
Joined
Aug 19, 2003
Messages
5,703
Platform
  1. Windows
Hello,
have assumed the Master worksheet is the right most tab in your workbook and that you only have the size tabs mentioned.

Code:
Sub COMBINE_SHEETS()
    Application.ScreenUpdating = False
    Sheets(6).Cells.ClearContents
    Sheets(1).Rows(1).Copy Sheets(6).Range("A1")
    For MY_SHEETS = 1 To 5
        With Sheets(MY_SHEETS)
            .Rows("2:" & .Range("A" & Rows.Count).End(xlUp).Row).Copy
            Sheets(6).Range("A" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial (xlPasteValues)
        End With
    Next MY_SHEETS
    Application.CutCopyMode = False
    Application.ScreenUpdating = True
End Sub

also assume you only want the column headings once.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,561
Messages
5,596,846
Members
414,107
Latest member
Tigretto

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
Top