Forum Discussion
djs72
May 04, 2023Copper Contributor
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...
- May 04, 2023
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
HansVogelaar
May 04, 2023MVP
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 Subdjs72
May 04, 2023Copper Contributor
Thanks Hans!! It ran quickly and it looks like everything pulled as I wanted, but I'll give it a look through to be sure. I'm pretty good with tweaking existing script so I should be able to make this meet my needs for other projects too. Again, thanks for the help!