You can often force a row to delete by selecting a different cell and pressing Delete, or by changing the worksheet view to Page Break Preview. This happens because Excel locks cells containing data to prevent accidental overwriting.
What You'll Need
- A computer running Microsoft Excel (Windows or macOS).
- A worksheet containing the row you wish to remove.
- Basic knowledge of how to select cells and use keyboard shortcuts.
Step-by-Step
When you click the row number and press Delete, nothing happens, or you see a warning. This is almost always due to cell protection or filter settings. Follow these steps to resolve it.
- Check for Hidden Rows: Look at the row numbers on the left side of the screen. Do you see a gap? If you see two row numbers next to each other (e.g., 4 and 6), the row between them is hidden. Right-click on the visible row number (4) and select Unhide to reveal the missing row. Attempt to delete it again now that it is visible.
- Unlock the Worksheet: If the row is visible and still won't delete, it may be locked. Click any cell in your sheet to deselect previous selections. Go to the Home tab on the ribbon. In the Cells group, click Format and choose Protect Sheet. If the sheet is not protected, this option may be disabled or grayed out. If you see the Protect Sheet dialog, simply click OK without changing any settings. If the option is grayed out, proceed to step 3.
- Unlock Specific Cells: If you want to keep the protection on for other data but delete this row, you must unlock the cells in that row. Right-click the row header (the number) and select Format Cells. Go to the Protection tab. Uncheck the box that says Locked. Click OK. Now, go back to the Home tab > Format > Protect Sheet and enter a password if prompted, then click OK. The row should now be deletable.
- Use the Delete Key on a Different Cell: Sometimes the issue is the active cell. Click a cell below the row you want to delete (e.g., click cell A5 if you want to delete row 4). Do not click the row number itself. With the cell selected, press the Backspace or Delete key on your keyboard. This tells Excel to delete the content of the selected cell, and if the row below it has no data, the empty row will shift up, effectively removing it.
- Disable Filters: If you have a filter applied to your data, Excel may be hiding the row from you or preventing you from seeing it as deleted. Click the Data tab and look for the Filter button. If it is highlighted (blue), click it again to turn the filter off. You can now select and delete the row freely.
- Switch to Page Break Preview: This is a specific Excel quirk. Go to the View tab and click Page Break Preview. In this view, Excel displays the grid lines in black. Select the row you want to delete and press Delete. The row should disappear. Once done, return to the Normal view.
Common Mistakes
Users often make small errors that complicate the deletion process or cause new problems.
- Pressing Delete on the Wrong Cell: Selecting the row number and pressing Delete only deletes the cell content, not the row itself. You must use the Backspace key on a selected cell to trigger a row deletion, or right-click the row number and select Delete.
- Ignoring Hidden Rows: Assuming a row is missing entirely when it is simply hidden. Always check the row numbers on the left margin for gaps before assuming the data is gone.
- Forgetting to Save: After making changes to cell formatting or protection settings, you must save the file. If you don't save, those settings will revert to the default state the next time you open the file.
Tips
These tips will help you manage your Excel worksheets more effectively and avoid future issues.
- Use the Delete Key for Content: If you only want to remove the text or numbers from a row, press Delete while a cell in that row is selected. This is faster than right-clicking and choosing Clear Contents.
- Check for Merged Cells: If a row contains a merged cell that spans into the next row, Excel may behave erratically. It is often better to unmerge cells before deleting rows to ensure data integrity.
- Use Keyboard Shortcuts: Use Ctrl + - (minus sign) to delete rows and Ctrl + Shift + - to delete columns. This is much faster than using the mouse to right-click and select Delete.
Troubleshooting
If you have tried the steps above and the row still will not delete, try these more advanced methods.
- Check for External Links: A row might be linked to a formula in another sheet that is causing a conflict. Go to the Data tab and click Edit Links. If there are any external links, you may need to update or break these links before deleting the row.
- Use the Go To Special Feature: Sometimes a row contains a hidden object or a cell with a specific formatting issue. Press F5 on your keyboard to open the Go To dialog. Click Special and select Constants or Objects. This will highlight any problematic elements in the row. You can then delete them manually.
- Copy and Paste Values: If the row is part of a complex table with many formulas, you can often delete it by copying the data from the row below and pasting it into the row above, then deleting the bottom row. This preserves the formatting and formulas of the data below.
- Reset Workbook: If the entire sheet is behaving erratically, it may be corrupted. Create a new blank workbook and copy the data from the problematic sheet into it. This will strip out any hidden code or formatting errors.
Frequently Asked Questions
Why does Excel say "Cannot delete selected cells"?
This error usually means the cells are part of a table or have data validation rules that prevent deletion. Right-click the cell, select Data Validation, and check if there are restrictions listed. You can also try selecting a cell outside the table and pressing Delete.
How do I delete multiple rows at once?
Select the row numbers you want to delete by holding down the Ctrl key and clicking them one by one. You can also click the first row number, hold Shift, and click the last row number to select a continuous range. Right-click and choose Delete.
Does deleting a row affect other rows?
Yes. When you delete a row, all rows below it shift up to fill the gap. Any data that was in those lower rows will move up one position. This is why it is important to double-check that you are deleting the correct row.
How do I delete an empty row?
Excel has a built-in feature to remove empty rows. Select your data range, go to the Data tab, and click Remove Duplicates. In the dialog box, ensure only the checkbox for My data has headers is unchecked, and click OK. This will remove any rows that contain no data.
What if the delete button is grayed out?
If the Delete option in the right-click menu is grayed out, the sheet is likely protected. You must go to the Review tab and click Unprotect Sheet (you may need the password) to enable the Delete function.