Skip to main content

Excel: Password Protect/Unprotect All Excel Worksheets in One Go

Dear Friends..
We often feels need of protection to our important datas in excel.


Excel has protection that we can add to an Excel Worksheet via Tools>Protection>Protect Sheet. A password can also be supplied so that another user cannot unprotect it without the password.

A common question that peoples often asked is, "how can I password protect and unprotect all Worksheets in my Workbook in one go. I have many sheets and I have to protect and unprotect each Worksheet individually." Unfortunately there is no standard feature in Excel that will allow us to protect and unprotect all Worksheets in one go, however, we can use some fairly simple VBA code to do this for us. 

So here is the code which you can copy and paste in a any module in your worksheet.

Sub Protectallsheets()
Dim S As Worksheet
For Each S In ThisWorkbook.Sheets
S.Protect Password:="Enter your password"
Next
End Sub


The same way you can also use the following code to unprotect your sheets in one go.
Sub UnProtectAllsheets()
Dim S As Worksheet
For Each S In ThisWorkbook.Sheets
S.Unprotect Password:="Enter your password"
Next
End Sub

Hope you will like it.

Comments

  1. Thank you! It is useful and necessary article. I use this program Manyprog Excel Password Recovery - http://manyprog.com/excel-password-recovery.php

    ReplyDelete

Post a Comment

Popular posts from this blog

How to Calculate Detention of Vehicles considering the complex Date & Time in excel

Some times it is difficult to calculate some cases which deals with Date & Time and calculating the Detention charges is one of them. Please download the excel file (and do remember that it has been prepared on the basis the following basis.... which can be changed with the help of formulas) https://drive.google.com/file/d/0Bw1qNoQ8YzHZY3E5VVl1SUduWm8/view?usp=sharing

Sai Sampurna Padhi - A Sweet Bubbly Girl fighting for her life at Cuttack

Hello Everyone, Today I want to share with you all about a girl named "Sai Sampurna Padhi" Some details of this girl: - Name                   : - Sai Sampurna Padhi Age                       : - 2.5 Years Residence           : - Bidanasi, Cuttack, Odisha Father's Name    : - Linku Padhi Mother's Name   : - Chandrika Mohapatra Father's Occupation    : - Auto Driver at Badambadi Bus Stand, Cuttack This girl is admitted to SCB Medical College because she is suffering from a very dangerous disease called "Blood Cancer" and as its at Stage-I doctors has prescribed to go for Bone Marrow transplant as soon as possible so that this can be cured. But the operation cost around 20-25 Lacks which they can't arrange. For the time being, every week she has need of blood, plasma, test & medicine which is less as it is a government ho...

FAQs on Hydroponics

From last several weeks I was searching for this on web and now wanted to share it.. For those who do not know about "Hydroponics" , Let me tell you that this is an alternative to our conventional method of Farming.  Hydroponics in simple words is "the process of growing plants in sand, gravel, or liquid, with added nutrients but without soil." Why we need it because the urbanization is growing rapidly and the agriculture land along with manpower & labour is going down and rarely available. We have now to focus on some alternatives for our food. Here are the FAQ List which will help. What is Hydroponics? Hydroponics is the method of growing plants using a soilless media which could include a wide variety of examples like: gravel, peat, vermiculite Perlite, old rubber tires, rockwool, and expanded clay aggregates. The minerals that the plant needs are dissolved into the water which is then watered directly to the plants. So, in short instead of the pl...