Skip to main content

How to protect multiple worksheets at once in Excel?

Author Xiaoyang Last modified

Supposing you have a workbook which contains multiple worksheets, and now you need to protect all of the worksheets or some specific worksheets, normally in Excel, you only can protect the sheet one by one with the Protect Sheet function, but this method is tedious and time-consuming if there are numerous sheets that need to be protected. How do you protect multiple sheets at once in Excel quickly and easily?

Protect all sheets at once with VBA code

Protect multiple sheets at once with Kutools for Excel

Unprotect multiple sheets at once with Kutools for Excel


arrow blue right bubble Protect all sheets at once with VBA code

With the following VBA code, you can protect all the sheets of the active workbook at once with the same password, do as this:

1. Hold down the ALT + F11 keys, and it opens the Microsoft Visual Basic for Applications window.

2. Click Insert > Module, and paste the following code in the Module Window.

VBA code: Protect all worksheets in a workbook at once:

Sub protect_all_sheets()
top: 
pass = InputBox("password?") 
repass = InputBox("Verify Password") 
If Not (pass = repass) Then 
MsgBox "you made a boo boo" 
Goto top 
End If 
For i = 1 To Worksheets.Count 
If Worksheets(i).ProtectContents = True Then Goto oops 
Next 
For Each s In ActiveWorkbook.Worksheets 
s.Protect Password:=pass 
Next 
Exit Sub 
oops: MsgBox "I think you have some sheets that are already protected. Please unprotect all sheets then running this Macro." 
End Sub

3. Then press F5 key to run the code, and input the password for the protected sheets in the prompt box, see screenshot:

A screenshot showing the prompt to enter a password for protecting multiple sheets in Excel

4. Click OK, and then input the password again to confirm the password.

A screenshot confirming the password for protecting multiple sheets in Excel

5. Then click OK, and all the sheets have been protected with the same password.


arrow blue right bubble Protect multiple sheets at once with Kutools for Excel

Sometimes, you don't want to protect all the sheets in your workbook, and only want to protect some specific sheets, in this situation, the above code will not work. But with Kutools for Excel’s Protect Worksheet utility, you can protect both all sheets and specific sheets quickly and easily.

Kutools for Excel offers over 300 advanced features to streamline complex tasks, boosting creativity and efficiency. Itegarate with AI capabilities, Kutools automates tasks with precision, making data management effortless. Detailed information of Kutools for Excel...         Free trial...

After installing Kutools for Excel, please do as following steps:

1. Click Kutools Plus > Protect Worksheet, see screenshot:

A screenshot showing Kutools' Protect Worksheet feature in Excel

2. In the Protect Worksheet dialog box, select the sheets that you want to be protected. (By default, all the worksheets within the current workbook are checked.) See screenshot:

A screenshot showing selected worksheets to protect

3. And click OK, and then type and confirm the password in the Protect Worksheet dialog box. See screenshot:

A screenshot showing the password confirmation dialog for protecting multiple sheets

4. Then click OK, the selected worksheets have been protected.

Click Protect Worksheet to know more about this feature.


arrow blue right bubble Unprotect multiple sheets at once with Kutools for Excel

How could you unprotect multiple protected worksheets in a workbook at the same time? Of course, Kutools for Excel also provides the Unprotect Worksheet utility for you to unprotect them at once.

Please do with following steps:

1. Open your workbook which contains the protected worksheets.

2. Then click Kutools Plus > Unprotect Worksheet, see screenshot:

A screenshot of the Unprotect Worksheet feature in Kutools tab on the ribbon

3. In the Unprotect Worksheet dialog box, the protected sheets are list into the list box, then click Ok button, see screenshot:

A screenshot showing the list of protected sheets in the Unprotect Worksheet dialog

4. And then a Unprotect Worksheet dialog box pops out to remind you enter the password that you have created to protect the worksheets, see screenshot:

A screenshot of the prompt to enter the password for unprotecting multiple sheets

5. After typing the password, click Ok, all the checked worksheets in the list box have been unprotected.

Note: The worksheets must have the same password.

To know more about this Unprotect Worksheet feature.

Kutools for Excel - Supercharge Excel with over 300 essential tools. Enjoy permanently free AI features! Get It Now


arrow blue right bubble Demo: Protect or Unprotect all worksheets at once with Kutools for Excel

Kutools for Excel: Over 300 handy tools at your fingertips! Enjoy permanently free AI features! Download Now!

Related article:

How to unprotect multiple worksheets at once in Excel?

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!