The fastest way to delete blank lines in Excel
The quickest method depends on whether your blank rows are scattered throughout the sheet or grouped together. If they're scattered, use the Go To Special feature to select all blanks at once, then delete them in one action. If they're grouped, you can select them manually and delete as a block. Both take less than a minute once you know the steps.
Excel doesn't have a single "delete all blanks" button, but these two methods work for almost every situation. The Go To Special approach is faster when you have many scattered blanks. The manual selection works best when the blanks are in a few obvious places.
Key Takeaways
- Use Go To Special (Ctrl+H, then Find & Replace with regular expressions) to find and select all blank rows at once, then delete them together.
- For a simpler approach, select blank rows manually by clicking the row number on the left, holding Ctrl, and clicking additional row numbers, then right-click and delete.
- Sorting your data by any column will push all blank rows to the bottom, making them easy to select and remove as a group.
- Always save a copy of your spreadsheet before deleting rows, in case you need to undo changes across multiple steps.
- Blank columns work the same way as blank rows — select by column letter, right-click, and delete.
Method 1: Select and delete blank rows manually
This method works best when you have a small number of blank rows or they're easy to spot. Click the row number on the left side of the spreadsheet to select an entire row. The row number turns blue when selected.
Hold down Ctrl and click additional row numbers to select multiple blank rows at the same time. You can select as many as you need — they don't have to be next to each other. Once all the blank rows are highlighted in blue, right-click on any selected row number and choose Delete from the menu. All selected rows disappear immediately.
Method 2: Sort to group blank rows together
Sorting pushes all blank rows to the bottom of your data in one step, making them much easier to select and delete as a single block. Click any cell in your data range, then go to the Data tab at the top and click Sort. A dialog box opens.
In the Sort dialog, choose any column from the dropdown menu — it doesn't matter which one. Make sure My data has headers is checked if your first row contains column titles. Click OK. Excel sorts your data and pushes every blank row to the bottom. Now select all the blank rows at the bottom by clicking the first blank row number, holding Shift, and clicking the last blank row number. Right-click and choose Delete.
Method 3: Use Find & Replace to locate blanks
This method finds every blank cell in your selected range and highlights them so you can delete the rows they're in. First, select the range of cells you want to search — or press Ctrl+A to select the entire sheet. Go to the Home tab and click Find & Replace (or press Ctrl+H).
In the Find & Replace dialog, leave the Find what field empty. Click Options to expand the dialog, then check the box for Match entire cell contents. Click Find All. Excel highlights every blank cell in your range. Close the Find & Replace dialog. Now all blank cells are selected. Click the first blank row number on the left, then hold Shift and click the last one to select entire rows instead of just cells. Right-click and choose Delete.
Deleting blank columns instead of rows
Blank columns work exactly the same way as blank rows. Click the column letter at the top to select an entire column. Hold Ctrl and click additional column letters to select multiple blank columns. Right-click on any selected column letter and choose Delete.
You can also sort to move blank columns to the right side of your data, then select and delete them together. The sorting method works the same way — go to Data > Sort, choose any column, and click OK. Blank columns move to the end of your data range.
What to do if you accidentally delete the wrong rows
Press Ctrl+Z immediately after deleting to undo the action. Excel keeps a history of your recent changes, so you can undo multiple times by pressing Ctrl+Z repeatedly. If you've closed the file and reopened it, the undo history is gone and you cannot recover deleted rows — this is why saving a backup copy before deleting is important.
If you're working with a file you can't afford to lose, use File > Save As to create a copy with a different name before you start deleting. Work on the copy, and if something goes wrong, you still have the original.
Avoiding blank rows when entering data
Blank rows often appear when you copy data from another source or when someone manually inserts empty rows for spacing. To prevent them in the future, avoid pressing Enter twice in a row when entering data, and be careful when copying from external sources — check for hidden blank rows before pasting.
If you're sharing a spreadsheet with others, let them know that blank rows can cause problems with sorting and filtering. A simple note in the file can prevent accidental blanks from being added later.
Frequently Asked Questions
Will deleting blank rows affect my formulas?
Yes. If a formula in another cell refers to a row you delete, that formula will show an error. Before deleting rows, check if any formulas reference them. You can use Find & Replace to search for cell references (like =A5) to see what formulas exist.
Can I delete blank rows from multiple sheets at once?
No, you have to delete from one sheet at a time. Select each sheet tab and repeat the deletion process. If you have many sheets with the same blank row pattern, consider using a macro, but that requires more advanced Excel knowledge.
What if some rows look blank but actually contain spaces or invisible characters?
These rows won't be caught by the standard blank row deletion methods. Use Find & Replace to search for a single space character, or use the TRIM function in a helper column to remove invisible spaces, then sort and delete the rows that become truly blank.
Does deleting blank rows change the row numbers of the rows below?
Yes. When you delete a row, all rows below it shift up and their row numbers change. This is normal and expected. If you have formulas that reference specific row numbers, they will adjust automatically in most cases.
Can I delete blank rows without selecting them first?
Not in a single action. You must either select the rows manually, sort them to group them, or use Find & Replace to highlight them. There's no command that deletes blanks without first identifying which rows are blank.