AccountantinExcel
New Member
- Joined
- Sep 10, 2018
- Messages
- 10
Good morning,
I am looking to use VBA to copy multiple sheets then paste values to a Summary sheet then remove all rows if Column A = 0. I have started with this code to copy sheets but am getting errors.
Sheet names:
G1 Sort Table
G2 Sort Table
G3 Sort Table
G4 Sort Table
G5 Sort Table
G6 Sort Table
G7 Sort Table
G8 Sort Table
G9 Sort Table
G10 Sort Table
Has anyone done this before?
"Sub SummurizeSheets()
Dim ws As Worksheet
Dim j As Integer, col As Integer
Application.ScreenUpdating = False
Sheets("Summary").Activate
For Each ws In Worksheets
If ws.Name = "G1 Sort Table" Then
ws.Range("A1:M40000").Copy
Row = Worksheets("Summary").Range("M40000").End(xlToLeft).Column + 1
Worksheets("Summary").Cells(1, Row).PasteSpecial xlPasteValues
Application.CutCopyMode = False
End If
Next ws
Columns(1).Delete
Range("A1").Activate
Application.ScreenUpdating = True
End Sub"
Thanks,
Anthony
I am looking to use VBA to copy multiple sheets then paste values to a Summary sheet then remove all rows if Column A = 0. I have started with this code to copy sheets but am getting errors.
Sheet names:
G1 Sort Table
G2 Sort Table
G3 Sort Table
G4 Sort Table
G5 Sort Table
G6 Sort Table
G7 Sort Table
G8 Sort Table
G9 Sort Table
G10 Sort Table
Has anyone done this before?
"Sub SummurizeSheets()
Dim ws As Worksheet
Dim j As Integer, col As Integer
Application.ScreenUpdating = False
Sheets("Summary").Activate
For Each ws In Worksheets
If ws.Name = "G1 Sort Table" Then
ws.Range("A1:M40000").Copy
Row = Worksheets("Summary").Range("M40000").End(xlToLeft).Column + 1
Worksheets("Summary").Cells(1, Row).PasteSpecial xlPasteValues
Application.CutCopyMode = False
End If
Next ws
Columns(1).Delete
Range("A1").Activate
Application.ScreenUpdating = True
End Sub"
Thanks,
Anthony