Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Deleting Every X Rows without a Macro.

Deleting Every X Rows without a Macro

Written by Allen Wyatt (last updated April 27, 2020)
This tip applies to Excel 97, 2000, 2002, and 2003


1

When working with data retrieved from another source—such as another user or from an external program—you may have a need to remove certain rows from the data. It is not unusual, for instance, to have the need to remove every third row or every fifth row. The following general steps allow you to delete every X rows without using a macro.

  1. Insert two columns (A and B) on the far left side of the worksheet.
  2. In the new column A, use AutoFill to sequentially number the rows from 1 to the end.
  3. In cell B1 (assuming you have no header row), enter the formula =MOD(A1,3). (This formula assumes that you want to delete every third row. If you want to delete some other multiple of rows, substitute that number in place of the 3 in the formula.)
  4. Copy the formula downward to all the other cells in the B column.
  5. Choose Filter from the Data menu, then choose AutoFilter. Small drop-down lists appear at the top of each column in the worksheet.
  6. Using the drop-down list in column B, select the 0. Now, only those rows with a zero in column B appear.
  7. Select all the displayed rows and delete them.
  8. Turn off AutoFilter. (Repeat step 5 to do this.)
  9. Delete columns A and B.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2348) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Deleting Every X Rows without a Macro.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Special Characters in Pattern Matching

The most powerful search engine in Word uses pattern matching, but the way you specify special characters in a ...

Discover More

Changing the Maximum Undo Levels

Want to change the number of "undo" steps available when editing? You can't, because Word doesn't' really have a maximum. ...

Discover More

Printing Very Large Paper Sizes

Need to print on large pieces of paper? Word has a limit on the size of the paper it can use, but that might not be the ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More ExcelTips (menu)

Quickly Deleting Cells

If you need to delete a cell, the Delete key won't do it. (That only clears the contents of a cell; it doesn't delete the ...

Discover More

Conditionally Deleting Rows

Want to delete a bunch of rows in a worksheet based on the value in a certain cell of each row? There are a couple of ...

Discover More

Stopping the Deletion of Cells

You can delete cells from a worksheet, and Excel will move the remaining cells either to the left or upwards. Deletions, ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is six minus 4?

2020-04-27 13:17:21

Daniel Fruge

Thank you, Mr. Wyatt, for the tip. To substitute step 2 above, you could use this updated formula =MOD(ROW(A1),3).


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.