D
davegb
This is part of some code I wrote to limit acess to some spreadsheets.
It's supposed to ignore the sheet "(Code Key)". But it still asks for a
password.
Private Sub Workbook_SheetChange(ByVal ws As Object, ByVal Target As
Range)
Dim sShName As String
For Each ws In ActiveWorkbook.Worksheets
If Right(ws.Name, 7) <> "Monthly" Then 'ignore these sheeets
Select Case ws.Name
Case "(Code Key)" 'Excluded sheets
Exit Sub
Case Else 'if password hasn't been entered yet, then ask
for password
If bPwrdEntrd = False Then
Call PasswordEntry
End If
End Select
End If
Next
End Sub
I tried using CodeName instead of sheet name, but that didn't work
either. Does anyone see what is wrong?
Thanks again.
It's supposed to ignore the sheet "(Code Key)". But it still asks for a
password.
Private Sub Workbook_SheetChange(ByVal ws As Object, ByVal Target As
Range)
Dim sShName As String
For Each ws In ActiveWorkbook.Worksheets
If Right(ws.Name, 7) <> "Monthly" Then 'ignore these sheeets
Select Case ws.Name
Case "(Code Key)" 'Excluded sheets
Exit Sub
Case Else 'if password hasn't been entered yet, then ask
for password
If bPwrdEntrd = False Then
Call PasswordEntry
End If
End Select
End If
Next
End Sub
I tried using CodeName instead of sheet name, but that didn't work
either. Does anyone see what is wrong?
Thanks again.