Phil,
You can do this by putting code into the workbook module. Open the VB Editor (alt+F11), click View, Project Explorer if you can't see it already and then double click the ThisWorkbook icon. Some code like this should do what you want.
Private Sub Workbook_BeforeClose(Cancel As Boolean)
'Hide all sheets as "very hidden" i.e. can't be unhidden using
'Format, Sheet, Unhide.
Dim sht As Object
For Each sht In ThisWorkbook.Sheets
If sht.Name <> "Drums" Then
sht.Visible = xlSheetVeryHidden
End If
Next
End Sub
Private Sub Workbook_Open()
Dim pass As String, sht As Object
pass = InputBox("Please enter password if you wish to view all sheets", _
"Password")
If pass = "password" Then
For Each sht In ThisWorkbook.Sheets
sht.Visible = xlSheetVisible
Next
End If
End Sub
HTH,
Dax.
Thanxs - it worked 1st time....
but, do u know if it is possible to make the letters in the msgBox stared out like ******** instead of the letter.
Cheers
Phil
You can't make the inputbox display * rather than the actual characters typed. What you could do is create a simple userform with a textbox on it and carry out the same sheet hiding procedures. A textbox can be set to display * as the user types.
Regards,
Dax.
I've made the UserForm but how do i connect the VB Code to it...?
If u email me an excel sheet with 1 already on i work it out
Cheers
phil