Background
I have a workbook with 7 sheets but only 6 with data. All of these 7 sheets have the same structure/headings, it's just that the last sheet (sheet 7) is blank.
I want to write a code that will copy the contents of sheets 1-6 in the range of A2:J15 into the sheet 7 worksheet. I currently have a code that I have been using to test and see if it works but the code I have only copies and pastes from one worksheet only (see below). Any suggestions?
In the below, I have two sheets where I want the data to come from and the destination sheet where I want the data to go:
Sub sbCopyRangeToAnotherSheet()
Sheets("Source1").Range("A1:B10").Copy
Sheets("Source2").Range("A1:B10").Copy
Sheets("Destination").Activate
Range("A1:B10").Select
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub
.Select
/.Activate
. Instead, use worksheet variables to do it. Also, when you do that second.Copy
, it is "overwriting" your first.Copy
, effectively negating the need for that first line. Also, on your Sheet7, I assume you don't want to overwrite the data each time, but instead add the blocks of data from the other sheets to below the newely copied info? – BruceWayne