Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
select for choosing
Dear guys, I have a small urgent problem.
I have more than 10000 lines of data in one spreadsheet. I am trying to select the lines in every 5 lines in this sheet and copy it to another. at early stage of learning VB, and really couldnt find the right way. Thx |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
select for choosing
Do you mean you want to copy row 1 to another sheet, skip rows 2-4, copy row
5 to the next row on the other sheet, skip rows 6-9, copy row 10, and so on? "Jonathan" wrote in message ... Dear guys, I have a small urgent problem. I have more than 10000 lines of data in one spreadsheet. I am trying to select the lines in every 5 lines in this sheet and copy it to another. at early stage of learning VB, and really couldnt find the right way. Thx |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
select for choosing
Yes, exactly.
"Zone" wrote: Do you mean you want to copy row 1 to another sheet, skip rows 2-4, copy row 5 to the next row on the other sheet, skip rows 6-9, copy row 10, and so on? "Jonathan" wrote in message ... Dear guys, I have a small urgent problem. I have more than 10000 lines of data in one spreadsheet. I am trying to select the lines in every 5 lines in this sheet and copy it to another. at early stage of learning VB, and really couldnt find the right way. Thx |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
select for choosing
Johnathan, my math was a little off! Beginning with row 1 and skipping 5
each time would copy row 1,6,11, and so on. Is that what you want? The following code copies from Sheet1 and pastes in Sheet2. Copy this code and paste in a standard module and see if it does what you want. James Sub CopyEvery5th() Dim j As Long, k As Long, BtmRow As Long Worksheets("Sheet2").Cells.Clear Worksheets("Sheet1").Activate BtmRow = Cells(Rows.Count, "a").End(xlUp).Row k = 1 For j = 1 To BtmRow Step 5 Rows(j).EntireRow.Copy Destination:=Worksheets("Sheet2").Cells(k, "a") k = k + 1 Next j End Sub "Jonathan" wrote in message ... Yes, exactly. "Zone" wrote: Do you mean you want to copy row 1 to another sheet, skip rows 2-4, copy row 5 to the next row on the other sheet, skip rows 6-9, copy row 10, and so on? "Jonathan" wrote in message ... Dear guys, I have a small urgent problem. I have more than 10000 lines of data in one spreadsheet. I am trying to select the lines in every 5 lines in this sheet and copy it to another. at early stage of learning VB, and really couldnt find the right way. Thx |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
help with choosing formula | Excel Worksheet Functions | |||
Choosing pictures | Excel Programming | |||
Choosing Only One Of Three OptionButtons | Excel Programming | |||
Choosing a value from a row with more than one condition | Excel Discussion (Misc queries) | |||
Help on choosing the right way | Excel Programming |