People who work with large data sets often need simple things such as inserting/deleting rows or columns. While there are already many different (and simple) ways to add rows in Excel, when it comes to inserting a blank row after every other row (or every third or fourth row), things get a bit complicated.
Insert a Blank Row After Every Other Row
In this tutorial, I will show you some really simple ways to insert a blank row after every row in the existing dataset (or every nth row). Since there is no direct way to add rows in between rows, the method covered in this article are workarounds to make this happen, And if you’re comfortable with VBA, then you can do this with a single click.
Using Helper Column and the Sort Feature
Suppose you have a dataset as shown below and you want to insert a blank between the existing rows.
Below are the steps to insert blank rows between existing rows: You would notice that as soon as you click OK in the Sort dialog box, it instantly rearranges the rows and now you have a blank row after every row of your dataset. In reality, this is not really inserting a blank row. This sorting method is simply rearranging the data by placing blank rows from below the dataset in between the rows in the dataset. You can also extend the same logic to insert a blank row after every two rows or every three rows. Suppose you have the dataset as shown below and you want to get a blank row after every two rows. Below are the steps to do this: Similarly, in case you want to insert a blank row after every third row, use the number 3, 6, 9, and so on in Step 5.
Using a Simple VBA Code
While you need a lot of workarounds to insert alternate blank rows in Excel, with VBA it’s all a piece of cake. With a simple VBA code, all you need to do is select the dataset in which you want to insert a blank row after every row, and simply run the code (takes a single click). Below is the VBA code that will insert a blank row after every row in the dataset: The above code counts the total number of rows in the selection and uses a For Next loop to cycle through each row and insert a blank row after each existing row in the dataset. Here are the steps to place this VBA code in the VB Editor in Excel: Once you have the code in the VB Editor, you can now use this code to insert blank rows after every other row in the dataset. Here are the steps to use the code to insert blank rows after every row: That’s it! The above steps would instantly insert alternating blank rows in the dataset. There are many different ways to run a macro in Excel. For example, if you have to do this quite often, you can add this macro to the Quick Access Toolbar so that you can run it with a single click. You can read more about different ways to run macros here. In case you want to insert a blank row after every second row, you can use the below code: Hope you found this tutorial useful. You may also like the following Excel tutorials:
How to Delete Every Other Row in Excel (or Every Nth Row) Highlight EVERY Other ROW in Excel (using Conditional Formatting) How to Select Every Third Row in Excel (or select every Nth Row) Delete Blank Rows in Excel (with and without VBA) How to Quickly Select Blank Cells in Excel Hide Zero Values in Excel | Make Cells Blank If the Value is 0 Insert New Columns in Excel
There is a very minor error in one of the screenshots. “3. Click on the ‘Macros’ option” instruction, whereas “Visual Basic” is highlighted. Not a problem at all , but in case you wanted to fix it . Thanks again!