To do this, simply click on the Insert then on Module. The next thing you need to do is to insert a module. This will open the Microsoft Visual basic window. To do this, you simply need to press Alt + F11 keys simultaneously. You first need to open the Microsoft Visual basic on your in your Excel in order to perform a macro delete row. In order for us to delete entire row with VBA, we can proceed as follows Step 1: Open Microsoft Visual Basic
How to delete blank columns in excel 2010 code#
Using VBA to delete rows works in a more similar way with the Go To Special command, with the exception that this uses a code to delete rows in. We can also use VBA macro to delete blank rows. Deleting rows with empty cells with VBA Macro You will notice that all the rows with empty cells have been deleted. In this dialog box, you need to check the Entire row option. You will be presented with a Delete dialog box when you click on delete. Then click on delete.įigure 3: Click Delete Step 4: Check Entire row Now that you have selected all the blank cells in the column of the worksheet that you want to delete rows with blank cells, the next thing you need to do is right-click on any of the selected cells. This will select all the blank cells in the column.įigure 2: Go to special options Step 3: Right-click and delete Among these options, we have the “Blanks” option. Once you have opened the Go To Special dialog box, you will be able to see many special options. You will then be able to see Go To Special.įigure 1: Using Go To Special to delete rows with empty cells Step 2: Check the blanks option To do this, just head to the Home tab and click on the Find & Select. The first thing you need to do is to locate and click on the Go To Special command. Step 1: Click on the Go To Special command Procedure of getting rid of rows with blank cells. This method is most useful if you have data that is listed in only one column. One of the most used involves Find & Select> Go To Special > Blanks. There are many ways that we can use to delete a row if cell is blank.
How to delete blank columns in excel 2010 how to#
In this post, we shall look at how to delete empty rows in VBA. But you need to learn how to delete rows if cell is empty. If some rows have empty cells, then we should delete those rows. When cleaning up data for analysis, we are required to have all the cells in each of the columns filled with data. How to delete rows that contain empty cells in Excel – Excelchat