How to set and remove passwords in Excel

In desktop Excel for Windows, use File > Info > Protect Workbook > Encrypt with Password to require a password before the file opens. Use a password to modify if readers may open it read-only. Use worksheet protection to restrict which cells can be edited.

Choose the right level of protection

A password to open encrypts the file. A password to modify allows people without the password to open it read-only. Worksheet protection restricts edits to locked cells, and workbook structure protection limits operations such as adding, moving, or renaming sheets. Manage access separately for confidential data.

Set a password to open the file

  1. Keep the original and save a separate .xlsx copy. Open the File tab on the ribbon. For a macro-enabled .xlsm workbook, keep the original format when saving the copy so that macros are retained.
  2. Choose Info > Protect Workbook > Encrypt with Password.
  3. Enter a password, select OK, and enter it again to confirm. Check the case and keyboard layout, then save the file. Store the password in an approved password manager.
  4. Close and reopen the saved copy. Verify that the prompt appears and that the password opens the file. Microsoft cannot retrieve a forgotten password for you.

Microsoft Support guide to encrypting an Excel file

Set a password to modify while allowing read-only access

  1. Press F12 or use Save As > Browse to open the full Save As dialog. Choose Tools > General Options.
  2. Enter a Password to modify, confirm it when prompted, and save. Leave the Password to open field blank if readers should be able to open the file without a password.

Reopen the copy and check that you can choose Read Only without entering the modify password. Enter the password when testing whether you can open it for editing.

Microsoft Support comparison of file, workbook, and worksheet protection

Remove an existing password you know

  1. Open the file with its current password. Go to File > Info > Protect Workbook > Encrypt with Password, clear the password field, and select OK. Save the file to apply the change.
  2. To remove a password to modify, open with editing access. Use Save As > Tools > General Options and clear only the Password to modify field before saving. Check the two settings individually if both passwords were configured.
  3. Close and reopen the saved file to check that the relevant prompt is gone. Verify where the unprotected copy is stored and who can access it.

Protect a worksheet while keeping input cells editable

To let people enter data in B2:B5, select that range before protecting the sheet. Open Format Cells > Protection, clear Locked, and select OK.

  1. Right-click the worksheet tab and choose Protect Sheet, or open the command from Review.
  2. Allow the actions people need, such as selecting unlocked cells. Enter a password if you want Excel to require it to remove sheet protection.
  3. If you set a password, enter it again in the confirmation dialog.
  4. Test both cases. Check that B2:B5 accepts input and that a cell you left locked cannot be changed.
  5. To make changes later, choose Unprotect Sheet from Review or the sheet tab menu. Enter the current sheet-protection password if you set one.

Microsoft Support guide to protecting a worksheet