I saw the below code in another thread that does almost what I need it to do. The only thing is that I need to only select certain worksheets, not all. Is there an adjustment I can make to this code or is there something I can do differently?
Each worksheet has a table on it as well, is there a code I could use to just combine certain tables?
Each worksheet has a table on it as well, is there a code I could use to just combine certain tables?
Sub debit1()
'Combine all worksheets to the Summary sheet
'Created by Trevor G 30 June 2011
Dim ws As Worksheet
Dim wsSummary As Worksheet
Set wsSummary = Worksheets("Summary")
For Each ws In Sheets
If ws.Name <> "Summary" Then
ws.Activate
Range("a1").Select
Selection.CurrentRegion.Select
' Selects the current data area without the top row.
Selection.Offset(1, 0).Resize(Selection.Rows.Count - 1).Select
' Selects the visible cells of the selection.
' This is useful if data is filtered or contains hidden rows.
Selection.SpecialCells(xlVisible).Copy
wsSummary.Activate
Range("A1").Select
Do Until ActiveCell.Value = ""
ActiveCell.Offset(1, 0).Select
Loop
ActiveCell.PasteSpecial xlPasteAll
End If
Next
End Sub