Why not set the tex colour to white so as the spreadshhet can't be seen.
set up a button on the sheet and assign a macro that unprotects the sheet and sets the colour back to automatic. (easy to record)
Protect the sheet with a password
when the user presses the button it will prompt for a password before unprotecting the sheet and setting the colour back to automatic (visible)
Ps you will have to select all cells and format them as hidden (format cells, protection, hidden)priot to protecting the sheet as then unhide them in the macro otherwise they will be seen in the formula bar
Try this, i think it's does what you're asking. Copy it into your workbook module. Change "Sheet2" to the worksheet you're trying to protect.
Public PvSh As String
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If Sh.Name = "Sheet2" Then
Num = ActiveWindow.Index
Windows(Num).Visible = False
If InputBox("Enter Password", "Password") <> "Mypassword" Then
Sheets(PvSh).Select
End If
Windows(Num).Visible = True
End If
End Sub
Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
PvSh = Sh.Name
End Sub
Juan Pablo
Desired Scenario:
1. User opens spreadsheet.
2. Spreadsheet has four tabs.
3. User selects to view fourth tab (P&L).
4. Before able to view, user is prompted for a password.
5. If user enters correct password (airline), then allowed to view worksheet, else error message "incorrect password".
6. This password check happens each time the file is opened, but if the password is entered correctly once, then the password is not checked during the rest of file session.
Thanks in Advance!