How to Lock Column Width / Row Height in Excel
This tutorial demonstrates how to lock column width and/or row height in Excel.
Lock Column Width and Row Height
Sometimes you’ll need to prevent a user from changing the height and width of cells in Excel. This can be done by protecting a workbook.
Before protecting the workbook, first disable locked cells. If you don’t do this, you will prevent columns and rows from resizing, but you will also be blocked from editing the cell content.
- Select all cells in the worksheet by clicking on the small triangle in the upper left corner of cells.
- In the Ribbon, go to the Home tab, and click on the Number Format icon in the bottom right corner of the Number group.
- In the Format Cells window, (1) go to the Protection tab, (2) uncheck Locked, and (3) click OK.
- Now, you can protect the worksheet. In the Ribbon, go to Review > Protect Sheet.
- Enter a password, then (2) check all options except Format columns and Format rows, and (3) click OK.
Note: If you want to lock column width only, leave only Format columns unchecked. On the other hand, if you want to lock row height only, only uncheck Format rows.
- In the pop-up window, just confirm the previously entered password and click OK.
Now, you can’t resize columns or rows. If you right-click on any column header (column letter), you can see that the Column Width… option is grayed out, which means that it’s disabled. Also, you can’t hide or unhide columns.
Similarly, if you right-click on any row heading (row number), the Row Height… option is disabled.
You can’t drag columns or rows to resize them either.
See also: VBA Set Column Width or Row Height.