T
Tod
Here's a crude method. It'll show only one sheet, based on
the users password. If the user password is not recognized
it shows a Title sheet. You should also password-protect
your code.
You can play around with this to show more than one sheet,
etc.
tod
Private Sub Workbook_Open()
Dim ShowSheet As String
For Each ws In ThisWorkbook.Worksheets
If ws.Name = "Title" Then
ws.Visible = True
Else
ws.Visible = False
End If
Next ws
PW = InputBox("Enter your Password", "Password Entry")
Select Case PW
Case "Tod"
ShowSheet = "Tod"
Case "Wilma"
ShowSheet = "Wilma"
Case "Betty"
ShowSheet = "Betty"
Case "Fred"
ShowSheet = "Fred"
Case Else
ShowSheet = "Title"
End Select
For Each ws In ThisWorkbook.Worksheets
If ws.Name = ShowSheet Then
ws.Visible = True
Else
If ws.Name <> "Title" Then
ws.Visible = False
End If
End If
Next ws
If ShowSheet <> "Title" Then ThisWorkbook.Worksheets
("Title").Visible = False
End Sub
them to be able to view anything on those specific
sheets. Excel's password protection seems to be either at
the workbook level or on elements within the worksheet.
worksheet and then protect the workbook structure, but
neither of those solutions are right for what I'm trying
to do.
the users password. If the user password is not recognized
it shows a Title sheet. You should also password-protect
your code.
You can play around with this to show more than one sheet,
etc.
tod
Private Sub Workbook_Open()
Dim ShowSheet As String
For Each ws In ThisWorkbook.Worksheets
If ws.Name = "Title" Then
ws.Visible = True
Else
ws.Visible = False
End If
Next ws
PW = InputBox("Enter your Password", "Password Entry")
Select Case PW
Case "Tod"
ShowSheet = "Tod"
Case "Wilma"
ShowSheet = "Wilma"
Case "Betty"
ShowSheet = "Betty"
Case "Fred"
ShowSheet = "Fred"
Case Else
ShowSheet = "Title"
End Select
For Each ws In ThisWorkbook.Worksheets
If ws.Name = ShowSheet Then
ws.Visible = True
Else
If ws.Name <> "Title" Then
ws.Visible = False
End If
End If
Next ws
If ShowSheet <> "Title" Then ThisWorkbook.Worksheets
("Title").Visible = False
End Sub
use a password to view specific worksheets. I don't want-----Original Message-----
Hi,
I am trying to set up a spreadsheet in which a user must
them to be able to view anything on those specific
sheets. Excel's password protection seems to be either at
the workbook level or on elements within the worksheet.
then password protect that sheet, or I could hide a wholeI know that I could hide the contents of a worksheet and
worksheet and then protect the workbook structure, but
neither of those solutions are right for what I'm trying
to do.