Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Protecting Multiple sheets with prompt for password to unprotect
Subject pretty much says it all, I need to be able to protect & unprotect 31 sheets in a workbook, but I also need it to ask for a password to unprotect.
|
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Protecting Multiple sheets with prompt for password to unprotect
Sub drinkme() Dim wks As Worksheet For Each wks In ThisWorkbook.Worksheets wks.Protect "mypassword" Next End Sub Sub eatme() Dim wks As Worksheet, strPassword As String, blnError As Boolean strPassword = InputBox("What's the password?") If strPassword = "" Then Exit Sub On Error Resume Next blnError = False For Each wks In ThisWorkbook.Worksheets wks.Unprotect strPassword If Err Then MsgBox "Password incorrect", vbExclamation blnError = True Exit For End If Next If Not blnError Then MsgBox "Done!", vbInformation End Sub Rob "pkley" wrote in message ... Subject pretty much says it all, I need to be able to protect & unprotect 31 sheets in a workbook, but I also need it to ask for a password to unprotect. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Password protecting multiple spreadsheets at once | Excel Discussion (Misc queries) | |||
I forget the password of protecting sheet, I need to unprotect it | Excel Discussion (Misc queries) | |||
Password protecting sheets in a workbook | Excel Worksheet Functions | |||
How do I unprotect multiple sheets simultaneously? | Excel Discussion (Misc queries) | |||
Password Protecting Sheets in Excel So Others Can't See Certain Sh | Excel Worksheet Functions |