Create a cell with the password you need and name it "GetThePassword". Then
try the code below. You should be able to adapt it to suit your needs.
'Make workbook ready for development
'
Sub StartDevelopment()
Dim mySheet As Worksheet
Dim Password As String
' read the password from the named range
Password = [GetThePassword]
'check password
If UCase(InputBox("Password: ")) <> UCase(Password) Then
MsgBox "Wrong password.", vbOKOnly + vbCritical, "Sorry..."
Exit Sub
End If
'unprotect the workbook, and then all the sheets
ActiveWorkbook.Unprotect (Password)
For Each mySheet In Sheets
With mySheet
.Unprotect (Password) 'unprotect the sheet
.Visible = xlSheetVisible 'unhide the sheet
End With
Next
End Sub
> Hi Excel People
>
[quoted text clipped - 9 lines]
>
> Brian