Pull Several rows from each tab into a summary sheet

djb113

New Member
Joined
Apr 17, 2014
Messages
2
Hello,

I have a spreadsheet where I want to pull rows 11-17 from each tab into a summary sheet. All of the tabs have the same structure, but different data for each market, so I'm trying pull it all into one data source. Can anyone advise on how I can do this with VBA? Thanks!
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Change in the macro "summary" to the name of your summary sheet

Code:
Sub Fill_summary()
    Dim ws As Worksheet, sh As Worksheet, n As Long
    
    Application.ScreenUpdating = False
    
    Set ws = Sheets("[COLOR=#0000ff]summary[/COLOR]")
    ws.Rows("2:" & Rows.Count).ClearContents
    n = 2
    For Each sh In Sheets
        If sh.Name <> ws.Name Then
            sh.Rows("11:17").Copy
            ws.Range("A" & n).PasteSpecial xlPasteValues
            n = n + 7
        End If
    Next
    
    Application.CutCopyMode = True
    Application.ScreenUpdating = True
    
    MsgBox "End"
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,752
Members
448,989
Latest member
mariah3

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