Protection of worksheets

A

Asiageek

Can worksheets be protected by one password rather than passwords for each
worksheet? I am using certain ranges allowed to be edited/used by the user
but not all worksheets are the same usable ranges.

Possible based on my current settings for the worksheets, can be protected
by one password and yet the data will continue to update itself?

Tired of entering the password for all sheets to change things!
 
P

Pranav Vaidya

Hi,

Here are 2 custom routines which will help you protect and unprotect all the
worksheets in the currently open workbook in one go.

Sub MyProtect()
Dim sht As Worksheet

For Each sht In ActiveWorkbook.Sheets
sht.Protect "abcd"
Next
End Sub


Sub MyUnprotect()
Dim sht As Worksheet

For Each sht In ActiveWorkbook.Sheets
sht.Unprotect "abcd"
Next
End Sub

Copy these in the VBA/Maro Editing window to your workbook and run.
Please note 'abcd' is the password, which you can replace as per your choice.

HTH,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top