Archive of Mr Excel Message Board
this is the code I have been using
Sub Hidesheet2macro()
'
' Hidesheet2macro Macro
' Macro recorded 06/21/2001 by Peter M.
'
' Keyboard Shortcut: Ctrl+Shift+H
If Sheets("sheet2").Visible = True Then
Sheets("sheet2").Select
ActiveWindow.SelectedSheets.Visible = False
End If
'Ask user for Password
Do
SrtPassword = InputBox("Enter,password")
'Enter SrtPassword="Youarein"
If ("Youarein") Then
Sheets("sheet2").Visible = True
Else
Temp = MsgBox("Call your Supervisor", 0)
End If
Loop Until SrtPassword = ("Youarein")

Try this instead.............your original was
trying to evaluate a string expression.
'
' Hidesheet2macro Macro
' Macro recorded 06/21/2001 by Peter M.
'
' Keyboard Shortcut: Ctrl+Shift+H
If Sheets("sheet2").Visible = True Then
Sheets("sheet2").Select
ActiveWindow.SelectedSheets.Visible = False
End If
'Ask user for Password
Do
SrtPassword = InputBox("Enter,password")
'Enter SrtPassword="Youarein"
If SrtPassword = "Youarein" Then
Sheets("sheet2").Visible = True
Else
Temp = MsgBox("Call your Supervisor", 0)
End If
Loop Until SrtPassword = "Youarein"
End Sub
