View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default 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?