Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 138
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 373
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 138
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 373
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
help with choosing formula TWP Excel Worksheet Functions 3 March 12th 09 03:32 PM
Choosing pictures Arnold Reedy Excel Programming 1 February 5th 06 01:25 PM
Choosing Only One Of Three OptionButtons Minitman[_4_] Excel Programming 2 August 18th 05 12:59 PM
Choosing a value from a row with more than one condition Yossi Excel Discussion (Misc queries) 4 April 19th 05 12:27 PM
Help on choosing the right way Antonis Excel Programming 2 September 4th 04 08:45 PM


All times are GMT +1. The time now is 09:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"