Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
MCI MCI is offline
external usenet poster
 
Posts: 11
Default how to get one row out of every two rows?

suppose file1 has 200 rows, i want to get the first row, third row,
fifth row, ..., and put these 100 rows to a new file (file2). do i have
to use vba, or i can directly do it in excel

thanks a lot!

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 196
Default how to get one row out of every two rows?

Hi

You could use a helper column and (in row1) place the following
formula:

=MOD(ROWS($A$1:$A1),2)

and copy down. Now you can use Autofilter (filter on the 1s) and then
copy and paste the visible rows.

Hope this helps!

Richard



MCI wrote:

suppose file1 has 200 rows, i want to get the first row, third row,
fifth row, ..., and put these 100 rows to a new file (file2). do i have
to use vba, or i can directly do it in excel

thanks a lot!


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default how to get one row out of every two rows?

VBA not needed.


In a helper column, say column Z, in Z1 enter
1
in Z2 enter
=IF(Z1=0,Z1+1,0) and copy down
you will see a column of alternating 1's and 0's

Then use autofilter to hide all the 0's (even rows) and copy/paste.

--
Gary's Student


"MCI" wrote:

suppose file1 has 200 rows, i want to get the first row, third row,
fifth row, ..., and put these 100 rows to a new file (file2). do i have
to use vba, or i can directly do it in excel

thanks a lot!


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 620
Default how to get one row out of every two rows?

Helper column, formula =MOD(ROW(),2)
Autofilter by that column, choosing value 1.
Copy the displayed column to your new file.
--
David Biddulph

"MCI" wrote in message
oups.com...
suppose file1 has 200 rows, i want to get the first row, third row,
fifth row, ..., and put these 100 rows to a new file (file2). do i have
to use vba, or i can directly do it in excel

thanks a lot!



  #5   Report Post  
Posted to microsoft.public.excel.misc
MCI MCI is offline
external usenet poster
 
Posts: 11
Default how to get one row out of every two rows?

thanks a lot, appreciate it!

RichardSchollar wrote:
Hi

You could use a helper column and (in row1) place the following
formula:

=MOD(ROWS($A$1:$A1),2)

and copy down. Now you can use Autofilter (filter on the 1s) and then
copy and paste the visible rows.

Hope this helps!

Richard



MCI wrote:

suppose file1 has 200 rows, i want to get the first row, third row,
fifth row, ..., and put these 100 rows to a new file (file2). do i have
to use vba, or i can directly do it in excel

thanks a lot!




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,572
Default how to get one row out of every two rows?

If this is an on going project, you can try this formula to copy over every
other row from Sheet1 to another sheet.

As you add more data to Sheet1, simply extend (copy) the formula down
additional rows to compensate for the new data.

=INDEX(Sheet1!A:A,2*ROWS($1:1)-1)

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"MCI" wrote in message
oups.com...
thanks a lot, appreciate it!

RichardSchollar wrote:
Hi

You could use a helper column and (in row1) place the following
formula:

=MOD(ROWS($A$1:$A1),2)

and copy down. Now you can use Autofilter (filter on the 1s) and then
copy and paste the visible rows.

Hope this helps!

Richard



MCI wrote:

suppose file1 has 200 rows, i want to get the first row, third row,
fifth row, ..., and put these 100 rows to a new file (file2). do i have
to use vba, or i can directly do it in excel

thanks a lot!



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
Rows & Columns in Excel seadragon69 Excel Worksheet Functions 2 December 7th 05 05:54 PM
Automatically inserting rows ausdiver99 Excel Worksheet Functions 1 June 2nd 05 02:15 PM
Hiding Rows if the linked rows are blank KG Excel Discussion (Misc queries) 9 May 18th 05 02:32 AM
flexible paste rows function that inserts the right number of rows marika1981 Excel Discussion (Misc queries) 1 February 18th 05 02:40 AM
Copying Rows when hiding other rows Neutron1871 Excel Worksheet Functions 2 November 3rd 04 11:38 PM


All times are GMT +1. The time now is 11:29 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"