PC Review


Reply
Thread Tools Rate Thread

Delete every other row in a 2007 spreadsheet

 
 
Legal Learning
Guest
Posts: n/a
 
      29th Apr 2008
I need to delete every other row in a 2000 row Excel 2007 spreadsheet. Could
someone help me with the code with this. I am ok with Word VBA but NOT Excel.


Thanks!
 
Reply With Quote
 
 
 
 
KC Rippstein hotmail com>
Guest
Posts: n/a
 
      29th Apr 2008
Sub deleteAlternatingRows()

For i = Cells(Rows.Count, "a").End(xlUp).Row To 2 Step -2
Rows(i).Delete
Next i

End Sub

--
Please remember to indicate when the post is answered so others can benefit
from it later.


"Legal Learning" wrote:

> I need to delete every other row in a 2000 row Excel 2007 spreadsheet. Could
> someone help me with the code with this. I am ok with Word VBA but NOT Excel.
>
>
> Thanks!

 
Reply With Quote
 
Zack Barresse
Guest
Posts: n/a
 
      29th Apr 2008
This is REALLY easy w/o VBA...

Use a helper (blank) column, insert a column if you'd like
At the start of your data (assuming you are not skipping blank rows, if so,
this isn't for you) put this formula =MOD(ROW(),2)
Copy down your entire data set
Filter on that column (Home tab | Editing group | Sort & Filter button) for
whichever odd/even row you want to delete (0 or 1)
Select the visible rows
Hit Ctrl + - (that is a minus sign)
Confirm delete entire row
Delete helper column

HTH

--
Zack Barresse



"Legal Learning" <(E-Mail Removed)> wrote in message
news:82B1572B-5A70-4998-A535-(E-Mail Removed)...
>I need to delete every other row in a 2000 row Excel 2007 spreadsheet.
>Could
> someone help me with the code with this. I am ok with Word VBA but NOT
> Excel.
>
>
> Thanks!


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
emailing part of spreadsheet using Excel 2007 and Outlook 2007 Brian Microsoft Excel Misc 1 12th Feb 2009 10:26 PM
hyperlink in Excel 2007 spreadsheet cell, to a Powerpoint 2007 sli Bob W Microsoft Excel Misc 7 9th Dec 2008 09:13 PM
delete spreadsheet =?Utf-8?B?Sm9obm55IE1pY2s=?= Microsoft Excel Programming 5 23rd Jun 2008 05:33 PM
How do I convert Excel 2007 Spreadsheet to Access 2007 database? =?Utf-8?B?RGF2ZUc=?= Microsoft Access 2 19th Oct 2007 11:17 PM
Is there a way to insert a formula, password or macro in an excel spreadsheet that will automatically delete the spreadsheet? oil_driller Microsoft Excel Misc 1 8th Feb 2005 09:34 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:30 PM.