Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Copy rows across sheets

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Copy rows across sheets

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy specific rows to different work sheets Joy New Users to Excel 3 April 7th 10 02:17 PM
copy rows to multiple sheets pvkutty Excel Discussion (Misc queries) 1 February 24th 10 07:25 AM
Copy all Rows from Several Sheets to 1 Sheet At Once KennyD Excel Discussion (Misc queries) 1 January 28th 10 04:56 AM
Copy rows between different sheets if condition met AUCP03 Excel Worksheet Functions 5 March 13th 09 01:45 PM
Copy rows from all sheets based on cell value Steph[_3_] Excel Programming 2 February 16th 05 10:19 PM


All times are GMT +1. The time now is 09:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"