Home Blog Archive MS Office Excel: Every second line is delete - is it possible?

Excel: Every second line is delete - is it possible?

  • Oct 25, 2025
  • 911
  • 0

With Microsoft Excel, you can delete every other row automatically. We explain in this practical tip of how this works.

First of all: developer tools display to delete any two line

  1. Click on the Office button in the top left, then select "Excel options".
  2. Go to "frequently used". You enable under "top options for working with Excel Option, developer tab in the ribbon bar".
  3. Confirm the Change using "Save".
Developer tools view

Excel: Every second line, delete with program code

Microsoft has released a program code that you can use. Proceed as follows:
  1. You can open the file in the relevant table data is located.
  2. Now click on "developer tools" and go under "Code" on the "Visual Basic".
  3. The Visual Basic Editor is now open. Here you click on "Insert" and "module".
  4. Copy the following Code (without the quotes) into the module: "Sub Delete_Every_Other_Row() 'Dimension variables. Y = False ' Change this to True if you want to 'delete rows 1, 3, 5, and so on. I = 1 Set xRng = Selection 'Loop once for every row in the selection. For xCounter = 1 To xRng.Rows.Count 'If Y is True, then... If Y = True Then '...delete an entire row of cells. xRng.Cells(I).EntireRow.Delete 'Otherwise... Else '...increment I by one so we can cycle through range. I = I + 1 End If 'If Y is True, make it False; if Y is False, make it True. Y = Not Y Next xCounter End Sub"
  5. Now go back to your Excel file and select the columns from which every second row should be deleted.
  6. Then click "developer tools" in the field "Code" to "macros". There you will see the Macro "Delete_Every_Other_Row", the start via "Run".
Every second line delete

Video tip: drop-down menu with Excel - how to

If you want to always insert the same values in an Excel table, saves you a drop-down menu lot of time. Our practical Video tip explains how you can create such a menu itself.
This practice tip was made with Excel 2007. With Excel you can also the interest rate interest rate or a three rate to calculate.

YOU MAY ALSO LIKE

0 COMMENTS

LEAVE A COMMENT

Human?
1 + 3 =