View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] gimme_this_gimme_that@yahoo.com is offline
external usenet poster
 
Posts: 129
Default Most efficent code to copy a row on one sheet to a row on another

I'm writing a run of the mil VBA Sub that iterates through one
worksheet and copies selected rows in another sheet. The row has 20
columns of data.

If

Dim i as Integer
Dim j as Integer
Dim s1 as Worksheet
Dim s2 as Worksheet
Dim b as Workbook
set b = ActiveWorkbook
set s1 = b.Sheets(1)
set s2 = b.Sheets(2)
i = 3
j = 7

' Most efficent code to copy 20 columns of data from s1.Rows(i) to
s2.Rows(j)
' I'd prefer not to have a For loop that iterates through 20 cells for
each row.

Thanks.