Get help

Help center

Guides and answers

Contact support

Write to our team

Sign in to

Workflows

Build processes with your team

Automations

Connect files and automate tasks

One system, four parts

AI agents

Virtual Employees that work 24/7

Automations

Connect files and automate tasks

Workflows

Build processes with your team

Data Space

Trusted data sharing and control

Solutions by department

Finance

Reports, budgets, and reconciliations

Inventory and manufacturing

Stock, orders, and production in one view

HR

Timesheets, attendance, and reviews

Project management

Status and workload across projects

Sales and CRM

Leads and deals kept up to date

Education

Student records and school data

Finance

Turn manual finance work into reports that update themselves.

What Finance teams automate

  • Track payables and receivables
  • Build cash flow statements
  • Compare budget against actuals

Inventory and manufacturing

See stock levels and automate ordering.

What inventory and manufacturing teams automate

  • Track inventory across multiple sites
  • Connect sales, purchasing, and warehouse data
  • Link a barcode scanner to your sheet

HR

Run recruitment, attendance, and OKR tracking from your sheets.

What HR teams automate

  • Track recruitment and onboarding
  • Record team OKRs and results
  • Track check-ins, check-outs, and leave

Project management

Assign tasks and track hours without manual updates.

What project teams automate

  • Assign tasks and track status changes
  • Estimate effort and log hours worked
  • Track milestones across projects

Sales and CRM

Track leads and sales performance with automated reports.

What sales teams automate

  • Track and convert leads
  • Set sales goals and track team metrics
  • Monitor sales KPIs on dashboards

Education

Automate attendance, grades, and school purchasing.

What schools automate

  • Track attendance and notify parents
  • Record and compare class grades
  • Track inventory lent to students and staff

Find a use case

By department

How each team uses Sheetgo

By industry

How each industry uses Sheetgo

By company size

Small, medium-sized, or large

Learn

Blog

Guides and product news

Customer stories

How teams like yours use Sheetgo

Help center

Guides and answers

Why Sheetgo

Compare

How Sheetgo compares with other tools

Security

How we protect your data

Trust center

Our compliance details

Sign in to

Workflows

Build processes with your team

Automations

Connect files and automate tasks

One system, four parts

AI agents

Virtual Employees that work 24/7

Automations

Connect files and automate tasks

Workflows

Build processes with your team

Data Space

Trusted data sharing and control

Solutions by department

Finance

Reports, budgets, and reconciliations

Inventory and manufacturing

Stock, orders, and production in one view

HR

Timesheets, attendance, and reviews

Project management

Status and workload across projects

Sales and CRM

Leads and deals kept up to date

Education

Student records and school data

Find a use case

By department

How each team uses Sheetgo

By industry

How each industry uses Sheetgo

By company size

Small, medium-sized, or large

Get started

Templates

Ready-made workflows to start from

Learn

Blog

Guides and product news

Customer stories

How teams like yours use Sheetgo

Help center

Guides and answers

Why Sheetgo

Compare

How Sheetgo compares with other tools

Security

How we protect your data

Trust center

Our compliance details

Help center

Guides and answers

Contact support

Write to our team

Workflows

Build processes with your team

Automations

Connect files and automate tasks

Protect and unprotect a sheet in Excel

It’s common for any Excel user to password-protect an Excel file, especially if your file contains complex formulae where cells are interlinked. You’ll want to avoid accidental edits that can break any formulae and distort your data completely. Although password-protecting is the best way to keep your data safe, managing to remove the password from Excel or read-only status can become a tedious task if you have forgotten the password.

Thankfully, Excel includes the Visual Basic for Applications (VBA) solution, which allows you to complete this process more quickly and efficiently. In this article, you’ll learn how to protect a sheet from Excel’s Review tab, then how to write VBA codes and use them to protect and unprotect an Excel sheet, with and without a password. If several people share and update the same Excel files, Sheetgo’s AI automations can move the data between them, so fewer people need to edit the protected source sheet.

How to protect a sheet in Excel from the Review tab

You don’t need VBA to protect a single sheet. Excel has a built-in option for it:

  1. Open the worksheet you want to protect.
  2. Go to the Review tab and click Protect Sheet. You can also right-click the sheet tab and choose Protect Sheet.
  3. Type a password if you want one. Leave the field blank to protect the sheet without a password.
  4. Under “Allow all users of this worksheet to”, tick what people can still do, such as selecting cells or formatting columns.
  5. Click OK. If you set a password, type it again to confirm.

Every cell is locked by default, so protection covers the whole sheet. To keep some cells editable, select them before you protect the sheet, press Ctrl+1, open the Protection tab, and clear the Locked box.

To unprotect the sheet, go to Review > Unprotect Sheet and type the password if Excel asks for it. The sections below do the same with VBA, which saves time when you have several sheets to protect.

How to enable the Developer tab in Excel?

Before learning how you can protect an Excel sheet without a password using VBA, make sure you have the “Developer” tab enabled for easier access.

1. Open the Excel sheet you’d like to protect without a password. Go to File > Options.

Excel protect sheet — Excel File screen with recent workbooks and Options at the bottom of the left menu

2. Select “Customize Ribbon” from the left-side menu. The “Developer” option should appear as selected, as shown below. Click “OK” to finish.

Excel protect sheet — Excel Options on Customize Ribbon with the Developer box ticked under Main Tabs

3. You should now see an additional tab in your Excel named “Developer”. Select “Visual Basic” from the far left, to launch VBA.

Excel protect sheet — Developer tab on the ribbon with Visual Basic at the far left

4. The VBA Editor should show up automatically, as illustrated below.

Excel protect sheet — empty code window in the Visual Basic for Applications editor

Protect a sheet without a password with VBA

Protecting a sheet without a password is a simple way of restricting others from making accidental changes to your data while maintaining their access. Although this can be done manually if you only have one sheet to protect, it will become a tedious process if you have more than one sheet that needs to be protected. For enhanced protection and code management, you might also consider using tools for code security.

1. Launch the VBA solution as shown and enter the following code in the first window.

Here, “ProjectList23” and “Main” are the variable parameters that you’ll need to adapt to the name of your workbook and worksheet.

2. Press “Enter” to execute the code.

VBA protect sheet — short Protect macro typed in the VBA editor code window

3. Excel may prompt you with the following “Can’t AutoSave” warning message. Select “Save As…” to change the format of the current file.

Excel protect sheet — yellow Can't AutoSave bar asking for a macro-enabled workbook, with a Save As button

4. If you try to “Save” directly, it will once again provide you with features that are incompatible with this type of format. Click “No”.

Excel protect sheet — Save As screen with a warning that the VB project can't be saved in a macro-free workbook

5. Change the format by selecting “Excel Macro-Enabled Workbook (*.xlsm)” from the drop-down menu next to “Save”. Click “Save” to finish.

Excel protect sheet — Save As file type list with Excel Macro-Enabled Workbook (*.xlsm) highlighted

6. You can now check if your sheet is protected by heading to the “Review” tab. It should now say “Unprotect Sheet”.

Protected worksheet in Excel — Review tab showing Unprotect Sheet after the macro ran

Now, you’ll learn how to do the reverse process using VBA.

Unprotect a sheet without a password with VBA

1. Launch VBA and type in the following code, once again adapted to the name of your file and sheet.

VBA unprotect sheet — Unprotect macro for the Main sheet in the VBA editor code window

2. Check to see if your sheet is now unprotected by heading to the “Review” tab. It should now say “Protect Sheet”.

Excel protect sheet — Review tab showing Protect Sheet again after the sheet was unprotected

So far, you’ve seen how to protect and unprotect a sheet without a password. If your data requires an additional level of protection, you can add a password using a similar VBA solution.

Protect a sheet with a password with VBA

Similar to what you did previously, this method will require using a straightforward code adapted to the name of your file, sheet, and then your choice of password.

1. Open the Excel workbook and activate the sheet you want to password protect with VBA. Type in the following code:

VBA protect sheet — macro that protects the Main sheet with a password in the VBA editor

2. To check that the code ran successfully, try clicking on any cell in the password-protected sheet. Excel should prompt you with the following message.

Protected worksheet in Excel — warning that the cell you're trying to change is on a protected sheet

Instead of entering the password, let’s see an easier way to unprotect the sheet using VBA.

Unprotect a sheet with a password with VBA

1. Open the Excel workbook and the sheet you want to unprotect. Type in the following code to remove the password.

VBA unprotect sheet — macro that unprotects the Main sheet with its password in the VBA editor

2. Check that the code ran successfully by heading to the Excel sheet and double-clicking on any cell. It should now allow you without prompting any warning or error message.

Excel protect sheet — a cell in the distribution column selected for editing with no warning

Although the codes shown are straightforward enough, you can also use the parameter activesheet.unprotect password and activesheet.protect password instead of the sheet name. You will simply have to make sure that the sheet you’d like to protect and unprotect is active.

Moreover, the code can adjust to the type and level of protection. For example, the VBA protect sheet code allows you to select locked cells to unprotect. This is very useful as they help speed up daily tasks, which can then be recorded as an Excel macro that you can run at any time instead of unlocking cells manually.

Conclusion

No matter the size or complexity of your dataset, if you are an Excel user, you’ll find that learning about VBA is definitely a plus. With basic and straightforward coding, you can save time completing daily and necessary tasks that usually take up most of your time. For example, protecting specific data to avoid losing data or breaking complex formulae.

You should now know how to enable quick access to VBA through the “Developer” tab and how to use four different VBA codes to protect and unprotect sheets in Excel, with and without a password.

If you prefer working on Google Sheets, then you may find how to password-protect a Google Sheet more suitable.

You may also like…

How to lock cells in Excel — Excel logo next to a green padlock on a mint background

How to lock cells in Excel? (cells, sheets & formulas)

Learn how to lock cells in Excel to stop accidental edits, plus how to protect a sheet and lock formulas, with steps for Windows and Mac.

Excel version control — stacked XLS file icon in teal on a dark navy background

The beginner’s guide to Excel version control

Discover what Excel version control is, the version control features Excel has to offer, and how to use them to share, merge, and review Excel changes.

How to remove password protection from Excel — Excel icon next to a padlock with a masked password on a light blue background

How to remove a password from Excel (multiple methods)

Learn how to remove password protection from Excel: unlock a file or a sheet when you know the password, and what to try if you’ve forgotten it.