Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy a range of cells 15 rows down and repeat to empty cell
On 5 Jun., 23:05, Mike V wrote:
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 Hi Which cell is the ActiveCell at the start of the macro, ie which column is used to determine last row to copy to? Regards, Per |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy a range of cells 15 rows down and repeat to empty cell
The active cell is K7 when the macro starts.
-- M.R. Vanatta "Per Jessen" wrote: On 5 Jun., 23:05, Mike V wrote: 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 Hi Which cell is the ActiveCell at the start of the macro, ie which column is used to determine last row to copy to? Regards, Per |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy Values to next empty cell range | Excel Worksheet Functions | |||
Copy cell contents in empty rows below it till any unempty row com | Excel Discussion (Misc queries) | |||
Copy cell to empty cells below. | Excel Programming | |||
find first empty cell in range and copy information from another workbook | Excel Programming | |||
Macro to copy cells one row up then move down 4 rows & repeat | Excel Programming |