How to Lock Column Width / Row Height in Excel

Written by

Editorial Team

Reviewed by

Laura Tsitlidze

Last updated on June 18, 2023

This tutorial demonstrates how to lock column width and/or row height in Excel.

lock columns rows resizing 7

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, it prevents columns and rows from resizing and blocks cell content from editing.

  1. Select all cells in the worksheet by clicking on the small triangle in the upper-left corner of cells.

lock columns rows resizing 1

  1. In the Ribbon, go to the Home > Number and click on the Number Format icon in the bottom-right corner of the group.

lock columns rows resizing 2

  1. In the Format Cells window, go to the Protection tab, uncheck Locked, and click OK.

lock columns rows resizing 3

  1. Now, you can protect the worksheet. In the Ribbon, go to Review > Protect Sheet.

lock columns rows resizing 4

  1. Type in a password, and then check all options except Format columns and Format rows. 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.

lock columns rows resizing 5

  1. In the pop-up window, just confirm the previously entered password and click OK.

lock columns rows resizing 6

Now, you can’t resize columns or rows. If you right-click any column header (column letter), you can see that Column Width is grayed out, which means that it’s disabled. Also, you can’t hide or unhide columns.

lock columns rows resizing 7

Similarly, if you right-click any row heading (row number), Row Height is disabled.

lock columns rows resizing 8

You can’t drag columns or rows to resize them either.

Tip: Try using VBA to set column width and row height.

AI Formula Generator

Try for Free

See all How-To Articles