Hi guys,
I hope you can help.
It should be something really simple.
I want a warning to appear when one activates certain sheets. I have tried the following, where I list the sheet names as follows:But this gives me a Run-time error: 13 Type mismatch.![]()
If Sh.Name = "DataBase" Or "List" Then
When a list a single sheet name as follows:it works fine.![]()
If Sh.Name = "DataBase" Then
Here is my code:
Thank you!![]()
Private Sub Workbook_SheetActivate(ByVal Sh As Object) If Sh.Name <> "DataBase" Then MsgBox "You may use this sheet!" Else If Sh.Name = "DataBase" Or "List" Then answer = MsgBox("Please use with caution!", vbOKCancel) If answer = vbCancel Then Sh.Visible = False End If End If End If End Sub
Bookmarks