ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Deleting every other row? (https://www.excelbanter.com/excel-discussion-misc-queries/129480-deleting-every-other-row.html)

The Joe

Deleting every other row?
 
I have a 25000 line spreadhseet and I need to delete every other row of it.
Is there a way to do so without manually deleting every row (12500 lines!!!).
Thanks

Mike

Deleting every other row?
 
a nice solution here

http://www.mcgimpsey.com/excel/deleteeverynthrow.html
"The Joe" wrote:

I have a 25000 line spreadhseet and I need to delete every other row of it.
Is there a way to do so without manually deleting every row (12500 lines!!!).
Thanks


Dave Peterson

Deleting every other row?
 
I would insert a new column A into the worksheet.

Then select A1:A25000
And type this formula (with a1 the active cell)
=MOD(ROW(),2)
But hit ctrl-enter to enter the formula in all the selected cells.

Then with A1:A25000 still selected
edit|copy
edit|paste special|values

Sort all the data by that column.

And delete the 12500 rows you don't want--either 0's or 1's in those cells.

Then delete column A.

The Joe wrote:

I have a 25000 line spreadhseet and I need to delete every other row of it.
Is there a way to do so without manually deleting every row (12500 lines!!!).
Thanks


--

Dave Peterson

[email protected]

Deleting every other row?
 
On Feb 6, 1:33 pm, The Joe wrote:
I have a 25000 line spreadhseet and I need to delete every other row of it.
Is there a way to do so without manually deleting every row (12500 lines!!!).
Thanks


I think this is simpler than a macro...you can use it for multiple
things..


Insert a column to the left of the data
Type a number 1 to the left of the data on the first row (in the new column)
Fill the column with consectuve numbers using data fill (highlight first row and second row-the blank row,

and then drag the little box in the botton of the area highlighted to
the end of the sheet).
This will product a column of consecutive numbers but on alternating
rows.
Sort the data (including the new column)
The blank rows will all be in the same area of the sheet
delete the blank rows
delete the new column

This will insure that your data is in the same order as previously.

Hope this helps....




All times are GMT +1. The time now is 12:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com