Ignoring End Statement
Charles Chickering wrote:
Try Exit Sub instead
--
Charles Chickering
"A good example is twice the value of good advice."
thanks for your help.
I changed it to Exit Sub. But XL doesn't seem to recognize the excluded
sheet names, so it never exits. I tried switching to code names, but
that doesn't work either. Any suggestions?
"davegb" wrote:
I got help here to use the Workbook sheet change event to protect some
worksheets. But the code first tests to see which sheet in the workbook
the user is changing, and allows it on some, prevents it on others. But
the End statement I put into the case doesn't execute, it's just being
ignored. Any ideas on what's going on here?
Private Sub Workbook_SheetChange(ByVal ws As Object, ByVal Target As
Range)
For Each ws In ActiveWorkbook.Worksheets
If Right(ws.Name, 7) < "Monthly" Then 'ignore these sheeets
Select Case ws.Name
Case "TOTALS", "CONTACT SUMMARY", "CONTACT SUMMARY by type",
"(Code Key)" 'Excluded sheets
End <----IGNORED
Case Else 'if password hasn't been entered yet, then ask
for password
If bPwrdEntrd = False Then
' Call EnterPassword(ws)
Call PasswordEntry
End If
End Select
End If
Next
End Sub
Thanks again!
|