Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a workbook with about 50 sheets. I need to copy all rows starting
from row 18 down from all sheets to one sheet called summary. Any suggestions other than going out of my mind and doing it manually? Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Assuming your data is:
1) in a big block (no gaps) 2) starts at row 18 column 1 3) has at least 2 bits of data on each page (the end(xldown) will not find the end of the data otherwise) then the following should do the trick Sub copyEighteen() Dim sht As Worksheet Dim rng As Range With Worksheets("Summary") For Each sht In ThisWorkbook.Worksheets 'Process all but the summary sheet If Not sht.Name = "Summary" Then If Not IsEmpty(sht.Cells(18, 1)) Then Set rng = Range(sht.Cells(18, 1), sht.Cells(18, 1).End(xlDown).End(xlToRight)) Range(.Cells(60000, 1).End(xlUp).Offset(1, 0), ..Cells(60000, 1).End(xlUp).Offset(rng.Rows.Count, rng.Columns.Count - 1)).Value = rng.Value End If End If Next End With End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
copy specific rows to different work sheets | New Users to Excel | |||
copy rows to multiple sheets | Excel Discussion (Misc queries) | |||
Copy all Rows from Several Sheets to 1 Sheet At Once | Excel Discussion (Misc queries) | |||
Copy rows between different sheets if condition met | Excel Worksheet Functions | |||
Copy rows from all sheets based on cell value | Excel Programming |