![]() |
is there a way to delete alternate rows in excel
I have a table generated by a datalog program running for about 7 days.
Unfortunately the log interval was inadvertantly set to 5 instead of 30 seconds, & the data now extends over 2 text files, each of about 65000 lines, close to the Excel 2003 limit. Can anyone advise a simple way to delete alternate rows, either in the text file or in the excel file? |
is there a way to delete alternate rows in excel
Hi,
To delete every other row in a worksheet. Right click the sheet tab, view code and paste this in:- Sub sonic() Dim x As Long Dim LastRow As Long LastRow = Range("A65536").End(xlUp).Row For x = LastRow To 1 Step -2 Rows(x & ":" & x).Delete Next x End Sub Mike "Martin R" wrote: I have a table generated by a datalog program running for about 7 days. Unfortunately the log interval was inadvertantly set to 5 instead of 30 seconds, & the data now extends over 2 text files, each of about 65000 lines, close to the Excel 2003 limit. Can anyone advise a simple way to delete alternate rows, either in the text file or in the excel file? |
is there a way to delete alternate rows in excel
Mike has a good solution but if VBA is not for you:
Insert a new A column In A1 enter 0, in A2 enter 1 Copy A1:A2 down to end of worksheet, resulting in 0,1,0,1,0,1.... Sort all the data using A as the key Now delete either the top or the top half Then delete column A best wishes -- Bernard V Liengme Microsoft Excel MVP www.stfx.ca/people/bliengme remove caps from email "Martin R" <Martin wrote in message ... I have a table generated by a datalog program running for about 7 days. Unfortunately the log interval was inadvertantly set to 5 instead of 30 seconds, & the data now extends over 2 text files, each of about 65000 lines, close to the Excel 2003 limit. Can anyone advise a simple way to delete alternate rows, either in the text file or in the excel file? |
is there a way to delete alternate rows in excel
Set up a column =MOD(ROW(),2), filter by that, & delete the unwanted rows.
If you've got data at 5 seconds instead of 30, it sounds like you might want =MOD(ROW(),6) -- David Biddulph "Martin R" <Martin wrote in message ... I have a table generated by a datalog program running for about 7 days. Unfortunately the log interval was inadvertantly set to 5 instead of 30 seconds, & the data now extends over 2 text files, each of about 65000 lines, close to the Excel 2003 limit. Can anyone advise a simple way to delete alternate rows, either in the text file or in the excel file? |
is there a way to delete alternate rows in excel
Hey, Bernard -- you should have a "MVP" logo after your name -- ask Mike F
about how this happens. And, in case I forgot, congrats! (Or am I mistaken??) "Bernard Liengme" wrote: Mike has a good solution but if VBA is not for you: Insert a new A column In A1 enter 0, in A2 enter 1 Copy A1:A2 down to end of worksheet, resulting in 0,1,0,1,0,1.... Sort all the data using A as the key Now delete either the top or the top half Then delete column A best wishes -- Bernard V Liengme Microsoft Excel MVP www.stfx.ca/people/bliengme remove caps from email "Martin R" <Martin wrote in message ... I have a table generated by a datalog program running for about 7 days. Unfortunately the log interval was inadvertantly set to 5 instead of 30 seconds, & the data now extends over 2 text files, each of about 65000 lines, close to the Excel 2003 limit. Can anyone advise a simple way to delete alternate rows, either in the text file or in the excel file? |
All times are GMT +1. The time now is 02:28 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com