ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to delete the even rows? (https://www.excelbanter.com/excel-programming/338820-how-delete-even-rows.html)

天方

How to delete the even rows?
 
I am a newbie.

I am not familiar with the VBA

Any one can tell me how to do that?



impslayer

How to delete the even rows?
 

天方 wrote:

I am a newbie.

I am not familiar with the VBA

Any one can tell me how to do that?


Hi,

Not sure how you access this newsgroup, but if you have access to
Google (www.google.com) you can search this (and other) usenet groups
very easily... You can for example put "delete even rows" in the search
box for this group (try
http://groups.google.com/group/micro...el.programming to
get to this group first) and you will get a couple of hits right away.

Try this approach first, then if you can't find the answer to your
question write another post here and I'm sure you will get plentiful
help!

Regards,

/impslayer, aka Birger Johansson


Norman Jones

How to delete the even rows?
 
Hi 天方,

I am not familiar with the VBA


For a non-programmatic solution, in the first cell of a helper column insert
the formula:

=ISODD(ROW())

Drag this formula down as far as required.
Autofilter the helper column using FALSE as the filter criterion
Delete the filtered even rows.

If you want a re-usable programmatic solution, turn on the macro recorder
and then run the above manual procedure. This will provide base code which
can be adapted for general application.

If you require assistance with such adaptation, post back.

---

Regards,
Norman



"天方" wrote in message
...
I am a newbie.

I am not familiar with the VBA

Any one can tell me how to do that?





Tom Ogilvy

How to delete the even rows?
 
in an empty column, (assume F), in F1 put the formula
=mod(row(),2)

then drag fill down the column for as far as you have data.

Now select the column and do Data=Filter=Autofilter

in the dropdown that appears in F1, select 0

Now only the even rows will be visible. Click on F2, then hold down the
shift key and click on the last visible row that you want deleted

then do Edit=Delete and select entirerow. Then do Data=Filter=Autofilter
(to turn off the filter) and the even rows should be gone

--
regards,
Tom Ogilvy


"天方" wrote in message
...
I am a newbie.

I am not familiar with the VBA

Any one can tell me how to do that?





Norman Jones

How to delete the even rows?
 
Hi 天方,

A possible downside to my suggestion, but not to Tom's solution, is that it
requires that the Analysis ToolPak be installed.

It is preferable, and much simpler, therefore, to use the natively available
Mod function!


---
Regards,
Norman



"Norman Jones" wrote in message
...
Hi 天方,

I am not familiar with the VBA


For a non-programmatic solution, in the first cell of a helper column
insert the formula:

=ISODD(ROW())

Drag this formula down as far as required.
Autofilter the helper column using FALSE as the filter criterion
Delete the filtered even rows.

If you want a re-usable programmatic solution, turn on the macro recorder
and then run the above manual procedure. This will provide base code which
can be adapted for general application.

If you require assistance with such adaptation, post back.

---

Regards,
Norman



"天方" wrote in message
...
I am a newbie.

I am not familiar with the VBA

Any one can tell me how to do that?







天方

How to delete the even rows?
 
Thank you all

I am very appreciated that you provided so many ways.

The problem has solved

Thanks a lot




All times are GMT +1. The time now is 03:07 PM.

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