Delete every other row.

C

ChuckF

I have a spreadsheet where we have collected data for the entire year.
Every other row needs to be cleared out. I need a way to be able to
clear the data from these cells automatically. Can anyone come up with
a macro for this.

This is what I have This is what I
want
1
1
2
3
3
4
5
5
6
7
7
8
9
9
 
K

Ken Wright

Delete the row or Clear the row? Very different results

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

------------------------------­------------------------------­----------------
It's easier to beg forgiveness than ask permission :)
------------------------------­------------------------------­----------------
 
C

ChuckF

Clear the cell. Not the entire row. Sorry that my example didn't show
the way I wanted it to. My real life examples are also not numbers.
It's just that I need to clear every other cell in a downward direction.
 
C

ChuckF

Whoops...it actually is the entire row. I want to keep row 1 but clear
the data from row 2, keep 3 clear the data from 4...so on and so on.
 
K

Ken Wright

OK, I'm assuming you really mean Clear the data and not Delete the row.

Assuming your data is in say A1:G1000, in cell H2 put the following formula
and copy down:-

=MOD(ROW(),2)

In cell H1 put a title eg FilterMe

Select H1:H1000 and do data / filter / autofilter and filter on whatever
number (0 or 1) appears against the rows you wish to clear.

Now select all your data and do Edit / Go To / Special / Visible cells only,
then hit delete. Now unfilter.

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

------------------------------­------------------------------­----------------
It's easier to beg forgiveness than ask permission :)
------------------------------­------------------------------­----------------
 
Top