View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
David Coleman[_4_] David Coleman[_4_] is offline
external usenet poster
 
Posts: 8
Default Copy rows between sheets-conditional

Hi William

There will be more efficient ways to do this but this certainly works and
takes 1 min, 43 seconds for 28000 source rows and 10,000 "to copy" rows.

Regards

David

=========

Sub test()
Dim srcrow As Integer
Dim dstrow As Integer
Application.ScreenUpdating = False

srcrow = 1
dstrow = 1
While (Sheets("raw data").Range("A" & srcrow).Value < "")
If (Sheets("raw data").Range("R" & srcrow).Value = "T") Then
Range("A" & srcrow & ":N" & srcrow).Copy
Sheets("input table").Select
Range("A" & dstrow).Select
ActiveSheet.Paste
Sheets("raw data").Select
dstrow = dstrow + 1
End If
srcrow = srcrow + 1
Wend

Application.CutCopyMode = False
Application.ScreenUpdating = True

End Sub


"William Elerding" wrote in
message ...
I would like to copy each row of sheet "Raw Data", colunms A-N, that has a
"T" in column 'R' onto a template on another sheet. This other sheet is
titled "Input Table", and I would copy into these same columns.

The number of rows in "Raw Data" could be up to 25,000 rows, and "Input
Table" maxed at 10,000.

Does anyone have recommendations for a reasonably efficient way to do
this?
The "Input Table" drives a number of pivot tables and graphs. Ideally,
I'd
be able to delete the "Raw Data" content after it copies over the
appropriate
rows.

Thank you in advance for any help!