Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quick way of deleting alternate rows

Status
Not open for further replies.

Binty

Materials
Sep 23, 2002
3
A data logger was unfortunately set to a very high sample rate, thus creating a huge file of mainly replicate data, which is too large to put into a single simple graph.

Is there an easy way of thinning out this file in excel, i.e. deleting every other line, to half the file size?
I only know how to do it longhand and the macros I tried to write haven’t been too successful!

It's probably quite simple, but obviously beyond my capabilities! - Any help appreciated, thanks.
 
Replies continue below

Recommended for you

Hello,

Try this code, it is a slight workaround but works.

Sub Macro1()
Range("a1").Select
Do Until ActiveCell = ""
Selection.Offset(1, 0).Select
Selection.EntireRow.Delete
Loop
End Sub



Hope this helps.

----------------------------------

maybe only a drafter
but the best user at this company!
 
Hello,

An alternative, should you have any blank cells

Sub Macro1()
Range("a1").Select
For Count = 1 To Range("a65536").End(xlUp).Row
Selection.Offset(1, 0).Select
Selection.EntireRow.Delete
Next Count
End Sub




Hope this helps.

----------------------------------

maybe only a drafter
but the best user at this company!
 
Maybe only a drafter but my hero today! Many thanks
 
another alternate:
add a column
enter 1 2 1 2
do a sort, and delete the 2's
 
If the order of data is important then philruh may want to add another column B filled with sequential integers. Sort by column A (1 2 1 2 ... )then by column B (1 2 3 4 ...) to preserve the original order. Then delete the 2's.
 
Activate the Data Analysis Tool that comes with Excel. This allows you to sample your dataset with a period of your choosing. This can then be output to a new sheet, or to a new workbook.

Cheers, Craig
 
Yes Maybe "only a drafter" but today you saved but! Many thanks
 
ASAP-utilities.com has a free application add-in that is pretty cool that automates many routine tasks in EXCEL. You should check it out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top