Watersource
New Member
- Joined
- Jan 3, 2009
- Messages
- 17
- Office Version
- 365
- 2016
- Platform
- Windows
Hello all,
I am trying to consolidate a number of named sheets (005, 007 and 030) into a report sheet. All sheets have the same columns, only number of rows is different. I have managed to pull it off for one sheet, but all my tries to get it working for multiple sheets have failed. Row 9 is a header row, all data can be found starting row 10. Hope you can give me some tips on this.
Thanks,
René
I am trying to consolidate a number of named sheets (005, 007 and 030) into a report sheet. All sheets have the same columns, only number of rows is different. I have managed to pull it off for one sheet, but all my tries to get it working for multiple sheets have failed. Row 9 is a header row, all data can be found starting row 10. Hope you can give me some tips on this.
VBA Code:
Sub CreateReport()
Dim lastrow As Long
Dim MySht, Mysheets
Mysheets = ("005", "007", "030")
Sheets("Report").Select
Range("A10").Select
Sheets("005").Select
Range("A10").Select
lastrow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
Rows("10:" & lastrow).Select
Selection.Copy
Sheets("Report").Select
Range("A10").Select
ActiveSheet.Paste
Selection.End(xlDown).Select
ActiveCell.Offset(1).Select
End Sub
Thanks,
René