View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mike V Mike V is offline
external usenet poster
 
Posts: 4
Default Copy a range of cells 15 rows down and repeat to empty cell

I have Excel 2003 and Windows XP.
My spreadsheet is currently 8,240 lines. I want to copy a range (containing
both absolute and relative cell references) of 15 lines and copy the range
down the 8,000 lines. The code I've tried is:

Sub loop1()
'this loop runs until there is nothing in the next column
Do
Range(Range("K7:R21"), Range("k7:R21").End(xlDown)).Copy Range("K22")
ActiveCell.Offset(1, 0).Select
Loop Until IsEmpty(ActiveCell.Offset(0, 1))
End Sub

It copies one line at a time and bogs down in fairly short order.

--
M.R. Vanatta