Good morning,
I have a spreadsheet with 5 or more sheets and I am trying to create code that will loop through sheets and copy the same range from each sheet to the "Overall Summary" sheet. The range should be copied into the next blank row.
Here is the code I have so far, please help.
Thank you
I have a spreadsheet with 5 or more sheets and I am trying to create code that will loop through sheets and copy the same range from each sheet to the "Overall Summary" sheet. The range should be copied into the next blank row.
Here is the code I have so far, please help.
Thank you
Code:
Sub CopyRangeFromMultiSheets()
'
' CopyRangeFromMultiSheets Macro
'
Dim sh As Worksheet
Dim DestSh As Worksheet
Dim Last As Long
Dim CopyRng As Range
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
'loop through all worksheets and copy the data to the DestSh
Set DestSh = Worksheet("Overall Summary")
For Each sh In ActiveWorkbook.Worksheets
If sh.Name <> DestSh.Name And sh.Name <> "Data Quality" And sh.Name <> "Confidence Level" And sh.Name <> "Standard Reporting Rules" And sh.Name <> "s*" Then
'Find the last row with data on the DestSh
Last = LastRow + 1
'Fill in the range that you want to copy
Set CopyRng = sh.Range("A5:G14")
Sheets("Overall Summary").Select
End If
Next ws
End Sub
Last edited by a moderator: