how to get one row out of every two rows?

M

MCI

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!
 
R

RichardSchollar

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
 
G

Gary''s Student

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.
 
D

David Biddulph

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

MCI

thanks a lot, appreciate it!
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
 
R

RagDyer

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)
 
Top