Workbook Protect / unprotect

Excel-ent

Active Member
Joined
Mar 4, 2004
Messages
338
Dear Experts,

I have 75 sheets in a workbook. All these sheets are protected with the Same Password. Is there any code to un-protect all the worksheets at the same time and another code to protect all these sheets at the same time.

I am using Windows 98 and Office 2000.

Thanks for all your efforts..

Regards,

Shan

P.S. I am sorry if this topic is discussed earlier, could not find it during my search.
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Just Shan said:
Dear Experts,

I have 75 sheets in a workbook. All these sheets are protected with the Same Password. Is there any code to un-protect all the worksheets at the same time and another code to protect all these sheets at the same time.

I am using Windows 98 and Office 2000.

Thanks for all your efforts..

Regards,

Shan

P.S. I am sorry if this topic is discussed earlier, could not find it during my search.

Try ASAP Utilities

www.asap-utilities.com
 
Upvote 0
Heya Shan,

Give this a shot:
Code:
Sub ProtectMe()
    Dim ws As Worksheet
        For Each ws In ActiveWorkbook.Worksheets
            ws.Protect Password:="password"
        Next ws
End Sub

Sub UnProtectMe()
    Dim ws As Worksheet
        For Each ws In ActiveWorkbook.Worksheets
            ws.Unprotect Password:="password"
        Next ws
End Sub
Hope that helps,

Smitty

(Hey Brian! :p How ya' doin?)
 
Upvote 0

Forum statistics

Threads
1,214,957
Messages
6,122,472
Members
449,087
Latest member
RExcelSearch

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top