Lock and Unlock Cells, Rows, or Columns in Excel

Protect specific cells, rows, or columns in Excel by toggling the locked property and then protecting the sheet. Reverse the process to allow edits again.

What the video covers

Applies to Microsoft Excel desktop versions that support worksheet protection (examples include Excel 365, 2021, 2019, 2016, 2013). Covers setting the Locked attribute on ranges and enabling/disabling sheet protection.

Watch the video on YouTube

Step-by-step instructions

  1. Select the cells, rows or columns you want to lock or unlock.
    Highlight the range(s) that should be protected (or made editable). You can select entire rows or columns if desired.
  2. Open the Format Cells dialog and go to the Protection tab.
    Use the cell formatting option to access the Protection settings where the Locked checkbox appears.
  3. Toggle the Locked checkbox for the selection.
    Check Locked to mark cells as locked, or uncheck Locked to make them editable when the sheet is protected. Click OK to apply.
  4. Protect the worksheet to enforce the Locked settings.
    Use the worksheet protection option (Review → Protect Sheet or equivalent) to turn on protection. Optionally set a password. Protection must be enabled for Locked settings to take effect.
  5. To unlock cells later, unprotect the sheet and change the Locked setting back.
    Remove sheet protection first (enter password if required), then select the cells and uncheck Locked via the Format Cells → Protection tab.

Watch the video

Video thumbnail for Lock and Unlock Cells, Rows, or Columns in Excel Play tutorial

Watch on YouTube

Why it matters

Locking cells prevents accidental or unauthorized edits to important data while allowing other parts of the sheet to remain editable. Unlocking makes cells editable again when changes are needed.

Check your result

After protecting the sheet, try editing a locked cell (it should be prevented) and an unlocked cell (it should allow edits). After unprotecting, previously locked cells should be editable.

Troubleshooting

If protection still allows edits, verify you protected the sheet after setting Locked/Unlocked states. If you are prompted for a password you don’t know, you cannot unprotect the sheet without that password. If some cells remain editable unexpectedly, ensure those ranges were not explicitly unlocked before protecting the sheet.