The fastest way to delete a line in Excel

To delete a row or column in Excel, right-click on the row number or column letter you want to remove, then select Delete from the menu that appears. The row or column disappears immediately, and all the data below or to the right shifts up or left to fill the gap.

If you need to delete multiple rows or columns at once, click on the first one, then hold Shift and click on the last one to select them all. Right-click and choose Delete, and they all vanish in one action. This works whether you're deleting rows, columns, or a mix of both.

Excel also has a Delete button in the Home tab at the top of the screen. Select the rows or columns you want to remove, click the arrow next to Delete in the Cells group, and choose Delete Entire Row or Delete Entire Column. Both methods do the same thing — the right-click menu is usually faster.

Key Takeaways

  • Right-click on a row number or column letter and select Delete to remove it instantly.
  • Select multiple rows or columns by clicking the first, holding Shift, and clicking the last, then delete them all at once.
  • Deleting a row or column shifts all data below or to the right upward or leftward automatically.
  • You can undo a deletion by pressing Ctrl+Z (or Cmd+Z on Mac) immediately after you delete.

Selecting rows and columns before you delete

The row number or column letter is the gray area on the left side (for rows) or the top (for columns) where Excel shows 1, 2, 3 or A, B, C. Click directly on that number or letter to select the entire row or column. The whole line turns blue or highlighted when it is selected.

To select a single row, click its number on the left. To select a single column, click its letter at the top. If you want to delete rows 5 through 10, click on row 5, then hold Shift and click on row 10. All six rows highlight at once. The same method works for columns — click column C, hold Shift, click column F, and columns C through F are selected.

Do not click inside a cell in the row or column. Click the row number or column letter itself. If you click inside a cell and then right-click, Excel will show you options for deleting the cell contents, not the entire row or column.

What happens to your data when you delete

When you delete a row, every row below it moves up one position. If you delete row 5, what was row 6 becomes row 5, row 7 becomes row 6, and so on. The same thing happens with columns — delete column B, and column C becomes column B, column D becomes column C.

Any formulas that refer to the deleted row or column will show an error (usually #REF!) because the cell they pointed to no longer exists. If you have a formula in row 20 that adds up rows 1 through 10, and you delete row 5, the formula automatically adjusts to add rows 1 through 4 and 6 through 10 instead. But if you delete a row that the formula depends on completely, the formula breaks.

This is why it is a good idea to check your spreadsheet for formulas before you delete anything. If you are not sure whether a deletion will cause problems, press Ctrl+Z (or Cmd+Z on Mac) right after you delete to undo it and review your work first.

Deleting rows or columns without losing data

If you want to remove a row or column but keep the data inside it, do not use the Delete command. Instead, select the row or column, right-click, and choose Delete Cells. A dialog box appears with options to shift cells left or shift cells up. Choose the direction that makes sense for your data, and the contents move but the row or column structure stays the same.

This is different from deleting the entire row or column. When you delete a cell and shift up, you are removing just that cell and moving everything below it upward — the row number stays the same. When you delete an entire row, you are removing the row itself, and all rows below it shift up by one position.

Most of the time, you want to delete the entire row or column, not just the cells. Use Delete Cells only if you have a specific reason to keep the row or column structure but remove the data from it.

Undoing a deletion you did not mean to make

If you delete a row or column by mistake, press Ctrl+Z (Windows) or Cmd+Z (Mac) immediately. Excel will restore it. You can undo multiple deletions by pressing Ctrl+Z several times, as long as you have not done anything else in the spreadsheet since the deletion.

Once you close the file without saving, you cannot undo the deletion. If you realize the mistake after you have already saved, you will need to manually recreate the row or column or restore from a backup if you have one. This is why it is good practice to save your work often but also to double-check before you delete anything important.

If you are working on a shared spreadsheet in Excel Online or Microsoft 365, the undo history may be limited. Undo still works, but it may not go back as far as it would in the desktop version of Excel.

Deleting blank rows to clean up your spreadsheet

Blank rows often appear in spreadsheets when data is imported from another source or when someone deletes content but leaves the row behind. To remove them, click on the row number of a blank row, then hold Shift and click on another blank row to select multiple blank rows at once. Right-click and select Delete. All the blank rows disappear, and your data compacts.

If you have many blank rows scattered throughout your spreadsheet, selecting them one by one is slow. A faster method is to use the Go To Special feature. Press Ctrl+H to open Find & Replace, leave the Find field empty, make sure Search is set to By Rows, and click Replace All. This removes all blank rows at once. However, this method is more advanced and works best if you are comfortable with Find & Replace.

For most situations, manually selecting and deleting blank rows is the safest approach. It takes a few extra seconds but gives you control over exactly what gets removed.

Frequently Asked Questions

Can I delete a row without losing the data in it?

Yes. Select the row, right-click, and choose Delete Cells instead of Delete. Then choose Shift Cells Up. The data moves up into the row above, and the row structure remains. However, this is different from deleting the entire row — it only removes the cells and shifts their contents.

What if I delete a row that contains a formula other cells depend on?

Any cell that references the deleted row will show a #REF! error. You can undo the deletion by pressing Ctrl+Z, or you can manually fix the formulas by editing them to point to a different row. There is no automatic fix — you have to correct them yourself.

How do I delete multiple non-consecutive rows at once?

Click on the first row number, then hold Ctrl (or Cmd on Mac) and click on each additional row number you want to delete. They all highlight. Right-click and select Delete, and all of them are removed at once. This works for columns too.

Will deleting a row affect my charts or pivot tables?

Yes. If a chart or pivot table is based on data in a deleted row, it will update to exclude that data. If the deleted row was essential to the chart, the chart may look different or show an error. Always check your charts and pivot tables after deleting rows or columns.

Can I delete a row in Excel Online the same way as desktop Excel?

Yes. Right-click on the row number and select Delete in Excel Online just like you would in the desktop version. The process is identical. Undo works the same way too — press Ctrl+Z to restore a deleted row.