10 Quick Tricks to Remove Blank Lines in Excel

The cell that doesn’t contain a least of words or values is called a blank cell. Hence, if there are multiple blank cells that don’t have any value are delineated as blank lines in Excel. Now consider a data sheet that has blank lines in the Excel sheet. In this case, we must remove lines in Excel. There are several methods to remove blank lines, cells, or rows in Excel. In this article, we are going to learn to remove blank lines in Excel.


📁 Download Excel File

To practice please download the Excel file from here:


Learn to Remove Blank Lines in Excel with These 10 Approaches

To learn to remove blank lines in Excel, we considered a dataset named Greatest Performers of 2022 containing First Name, Last Name, Category, and Age. There are 5 columns as well as 14 rows including blank lines in the dataset. In this article, to remove blank lines in Excel, we are going to use the Context menu option, keyboard shortcut, COUNTA function, COUNTBLANK function, Find and Replace Feature, Sort feature, etc. In addition, we are going to discuss the use of VBA Macro. To run VBA Macro save the workbook as .xlsm extension.

Dataset of how to remove blank lines in excel

Method

1. Delete Blank Rows by Selecting Manually

The simplest way to remove blank lines is to select the rows altogether and to get a Context Menu by Right-Click on the mouse to delete manually. Please follow the procedure below.

⬇️⬇️ STEPS ⬇️⬇️

  • Firstly, click on cells B6:E6, B10:E10, and B13:E13 holding Ctrl to select the cells altogether.

Blank lines to remove from the dataset in Excel.

  • Then Right-Click on the Mouse to get a Context Menu list.
  • Next, from the Context Menu, click on Delete from the list.

Context menu to remove lines.

  • Thus a Delete box appears.
  • After that, select Entire Rows and click on the OK button.

Delete box to delete lines.

  • Therefore, rows containing blank cells are erased.

Blank lines removed.

Method

2. One-Click Action to Remove Rows

By selecting lines and with the help of the keyboard key, one can easily remove any rows he wants. Please check the steps below.

⬇️⬇️ STEPS ⬇️⬇️

  • Firstly, click on cells B6:E6, B10:E10, and B13:E13 holding Ctrl to select the rows along with cells.
  • Secondly, Press Ctrl+-(Minus) from the Keyboard.
  • Thus a Delete box appears.
  • Thirdly, select Entire Rows and click on the OK button.

Find out blank lines and remove them with the keyboard shortcut.

  • Therefore, by removing 3 rows containing blank cells, we get the final output.

3 blank lines removed.

Method

3. Delete Empty Rows Using Keyboard Shortcut

To operate from Top Ribbon, the keyboard shortcut can be another key to delete rows containing blank cells. Please follow the procedure below.

⬇️⬇️ STEPS ⬇️⬇️

  • Primarily, click on cells B6:E6, B10:E10, and B13:E13 holding Ctrl to select lines.
  • Then press Alt to get the keys.
  • Next, press H for the Home menu.
  • After that, press D the Delete feature.
  • Further press R to select the Delete Sheet Rows option.

Keyboard keys to delete lines from the dataset.

  • Lastly, selected cells and rows remove, and get the final output.

Blank rows erased.

📕 Read More: 3 Approaches to Make Empty Cells Blank in Excel

Method

4. Remove Blank Cells Using Go To Special Feature

Suppose you are asked to find out blank rows and erase those rows to make the workbook concise. Use of the Go To Special option from the Find and Select feature from the Top Ribbon can be a key. Please follow the necessary steps.

⬇️⬇️ STEPS ⬇️⬇️

  • First, select the entire table.
  • Secondly, Click on Editing from the Home menu.
  • Then, click on Find and Select feature.
  • After that, select Go To Special option from the list.

Use of Go To Special feature to remove lines in Excel.

  • Therefore, the Go To Special Box appears.
  • Then, Select Blanks from the box and click on the OK button.

Go To Special box to find out the blanks.

Blank Lines determination to remove.

  • Again, Right-Click on the mouse to get a Context Menu list.
  • Next, from the Context Menu, click on Delete from the list.

Context Menu to get the Delete option.

  • Thus a Delete box appears.
  • After that, select Entire Rows and click on the OK button.

Delete box.

  • Therefore, rows containing blank cells are removed.

 3 blank lines were erased.

Method

5. Remove Blank Lines Using Find Command in Excel

Finding the blank rows you can delete rows containing blank lines easily. Please check out the steps.

⬇️⬇️ STEPS ⬇️⬇️

  • First, select the entire table.
  • Secondly, Click on Editing from the Home menu.
  • Then, click on Find and Select feature.
  • After that, select the Find option from the list.

Use of Find feature to remove blank lines.

  • Meanwhile, A box named Find and Replace appears.
  • In addition, Keep blank in Find what cell.
  • Then, Select Search by rows from the drop-down box.
  • After that, select Values in the Look in option.
  • Finally, click on Find All button.

Find and Replace box to find out blank lines.

  • Thus all the blank cells appear.
  • Pressing Alt+A, Select all the blank cells.

Location of blank cells.

  • Lastly, delete all the rows containing blank cells and get the final result without blank cells.

Blank lines eliminated.

📕 Read More: 4 Ways to Find and Replace Blank Cells in Excel

Method

6. Remove Blank Lines Using Filter Feature in Excel

Filtering the entire dataset you can filter out and delete rows containing blank lines as well as blank cells. Please check out the necessary steps.

⬇️⬇️ STEPS ⬇️⬇️

  • Initially, select the entire table.
  • Secondly, Click on the Sort and Filter from the Data Menu.
  • Thirdly, click on the Filter feature.

Use of Filter option to remove lines in Excel.

  • Now, a down box appears beside every heading of the table.
  • Next, From the drop-down box, de-select blanks to filter data.

De-selecting Blanks from the table.

  • Finally, by doing similar action, rows containing blank cells are eliminated and filtered data comes out as the final result.

Blank rows deleted.

Method

7. Remove Blank Lines By Sorting Them in Excel

Sorting the table of the dataset and deleting rows containing blank lines can be another way to remove blank lines. Please check out the below steps.

⬇️⬇️ STEPS ⬇️⬇️

  • Initially, select the entire dataset.
  • Secondly, Click on the Sort and Filter feature from the Data menu.
  • Thirdly, click on the Smallest to Largest option.

Selecting Ascending order feature to sort out blanks.

  • Therefore, blank lines take place at the bottom of the table.

Blank lines at the bottom.

Method

8. Remove Empty Rows at the Bottom

Counting blank cells and removing them accordingly is another way to erase rows containing blank cells. The COUNTBLANK function generally counts blank cells. Please follow the procedure.

⬇️⬇️ STEPS ⬇️⬇️

  • First, navigate a blank cell i.e. F6.
  • Second, insert the following formula containing the COUNTBLANK function.
=COUNTBLANK(B6:E6)

Use of COUNTBLANK function to find out blanks in a row.

  • Third, auto-filling the cells, and get the number of blanks.
  • Now, select the entire data of the Blank column.
  • Then, Click on the Sort and Filter feature from the Data menu.
  • Next, click on the Smallest to Largest option.

Counting blanks in a line.

  • Rows containing blank cells remain at the last 3 three rows.

Blank lines at the bottom.

  • Finally, delete the last 3 rows and get the data without blank cells.

 blank lines removed.

📕 Read More: 9 Quick Tricks to Delete Row If Cell is Blank in Excel

Method

9. Remove Blank Rows Using Formula

Using the function COUNTA which counts the values based on the presence of texts with TRUE FALSE. Please check out the necessary steps.

⬇️⬇️ STEPS ⬇️⬇️

  • Firstly, select a blank cell B6 at the first column of the table.
  • Secondly, type the following formula in the B6 cell containing the COUNTA function.
=COUNTA(C6:XFD6)=0

Use of COUNTA function to determine blank lines.

  • Thirdly, Using Fill Handle, fill the data with TRUEFALSE from B4 to B14 range.
  • Now, Select the entire dataset.
  • Then click on the Sort and Filter option from the Data menu at the Top Ribbon.
  • After that, select Sort [A to Z] for the Smallest to Largest option.

Based on True and False, sort out blank lines.

  • Finally, get the TRUE values in the last two rows.

Blank lines separation in a dataset.

  • Therefore, by Deleting the last two rows, you will get the final output without blank cells.

Blank rows were removed from the dataset.

📕 Read More: 4 Easy Ways to Fill Blank Cells in Excel with Formula

Method

10. Using VBA to Remove Lines in Excel

VBA code to remove blank lines in Excel also can be a way. With the enabling of the Developer option, you can generate a program of your own and erase unwanted blank rows. Please follow the steps.

⬇️⬇️ STEPS ⬇️⬇️

  • First, Check if your Developer option is available or not.
  • Then to enable the Developer option, Right-click on the mouse at the Top Ribbon and select Customize the Ribbon from the list.

Enabling VBA.

  • Click on Developer and click on the OK

Enabling the Developer option at the top ribbon.

  • Now Developer mode is on.
  • Next, Click on the Visual Basic option.
  • Then, to insert the VBA code, click on Module from the Insert menu.

MS VBA box to insert VBA code from the Developer menu.

  • Insert the following code in the Module and click Run to execute the VBA code.

Code

Sub Ewmove_3()
Range("C6,D10,E13").Select
Range("E13").Activate
Application.CutCopyMode = False
Selection.EntireRow.Delete
End Sub

VBA Macro code to remove blank lines from Excel.

  • Lastly, blank lines including blank cells eliminated.

Blank rows are deleted.


📄 Important Notes

🖊️  Measure the full range of rows or columns accurately while using the COUNTA function.

🖊️  SORT function is only available on Office 365.

🖊️  During working with VBA code, check whether your Developer tool is available.


📝 Takeaway from This Article

📌  In this article, we demonstrated general steps from the context menu, keyboard shortcut, and use of the Delete option from the Top Ribbon to remove blank lines from a dataset.

📌  COUNTA function to count text’s availability.

📌  COUNTBLANK function finds out and counts the number of blank cells.

📌  Find and Select feature to find blank lines and erase them.

📌  VBA to remove blank lines.


Conclusion

We demonstrated every possible way to remove blank lines in Excel. I hope you enjoyed your learning. Any suggestions, as well as queries, are appreciated. For better understanding and new knowledge don’t forget to visit www.ExcelDen.com.


Related Articles

(Visited 62 times, 1 visits today)
MD Tanvir Rahman

MD Tanvir Rahman

Hello, I am Tanvir. Graduated from BUET. Had a year-long Experience at Operation of Vitacan Industries Ltd. I found Excel is the most unique software to reduce both time and paper. Now, I am an Excel enthusiast, love to play with data and publish content.

We will be happy to hear your thoughts

Leave a reply

ExcelDen
Logo