Forum Discussion

djs72's avatar
djs72
Copper Contributor
May 04, 2023
Solved

Script to pull data from multiple tabs into new tab

Hi. I've never posted before and I'm not sure exactly how to phrase the help I need, so please excuse my wordiness ... I have a spreadsheet with roughly 600 tabs of all data, each tab is named for a...
  • HansVogelaar's avatar
    May 04, 2023

    djs72 

    Try this macro. It'll take a while to run with 600 sheets.

    Sub Copy2Master()
        Dim ws As Worksheet
        Dim wt As Worksheet
        Dim t As Long
        Application.ScreenUpdating = False
        Set wt = Worksheets("Master")
        For Each ws In Worksheets
            If ws.Name <> "Master" Then
                t = wt.Range("A" & wt.Rows.Count).End(xlUp).Row + 1
                wt.Range("A" & t).Resize(53, 3).Value = ws.Range("A2:C54").Value
            End If
        Next ws
        Application.ScreenUpdating = True
    End Sub

Resources