×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Quick way of deleting alternate rows

Quick way of deleting alternate rows

Quick way of deleting alternate rows

(OP)
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.

RE: Quick way of deleting alternate rows

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!

RE: Quick way of deleting alternate rows

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!

RE: Quick way of deleting alternate rows

(OP)
Maybe only a drafter but my hero today!  Many thanks

RE: Quick way of deleting alternate rows

another alternate:
add a column
enter 1 2 1 2
do a sort, and delete the 2's

RE: Quick way of deleting alternate rows

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.

RE: Quick way of deleting alternate rows

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

RE: Quick way of deleting alternate rows

Yes Maybe "only a drafter" but today you saved but!  Many thanks

RE: Quick way of deleting alternate rows

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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login



News


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close