Dear Friends..
We often feels need of protection to our important datas in excel.
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.
Thank you! It is useful and necessary article. I use this program Manyprog Excel Password Recovery - http://manyprog.com/excel-password-recovery.php
ReplyDelete