Marlton_07
New Member
- Joined
- Jul 8, 2012
- Messages
- 1
Please help.
I found this error in below codes.
'Created by Marlton A. Soliven
Option Explicit
Option Compare Text
'Password to unhide sheets
Const pWord = "*****"
Sub HideSheets()
'Set worksheet to Very Hidden so that it can only be unhidden by a macro
Worksheets("Accounting").Visible = xlSheetVisible (Error found here!)
End Sub
Sub ShowSheets()
'Prompt the user for a password and unhide the worksheet if correct
Select Case InputBox("Please enter the password to unhide the sheet", _
"Enter Password")
Case Is = pWord
With Worksheets("Accounting")
.Visible = xlSheetVisible
.Activate
.Range("A1").Select
End With
Case Else
MsgBox "Sorry, that password is incorrect!", _
vbCritical + vbOKOnly, "You are not authorized!"
End Select
End Sub
Option Explicit
Private Sub Workbook_Open()
'Turn off screen updates
Application.ScreenUpdating = False
'Hide confidential sheet at startup
Call HideSheets
'Activate cell A1 on the Dashboard sheet at startup
With Worksheets("Dashboard")
.Activate
.Range("A1").Select
End With
'Restore screen updates
Application.ScreenUpdating = True
End Sub
Appreciate anyone who can assist me.
Thank so much.
I found this error in below codes.
'Created by Marlton A. Soliven
Option Explicit
Option Compare Text
'Password to unhide sheets
Const pWord = "*****"
Sub HideSheets()
'Set worksheet to Very Hidden so that it can only be unhidden by a macro
Worksheets("Accounting").Visible = xlSheetVisible (Error found here!)
End Sub
Sub ShowSheets()
'Prompt the user for a password and unhide the worksheet if correct
Select Case InputBox("Please enter the password to unhide the sheet", _
"Enter Password")
Case Is = pWord
With Worksheets("Accounting")
.Visible = xlSheetVisible
.Activate
.Range("A1").Select
End With
Case Else
MsgBox "Sorry, that password is incorrect!", _
vbCritical + vbOKOnly, "You are not authorized!"
End Select
End Sub
Option Explicit
Private Sub Workbook_Open()
'Turn off screen updates
Application.ScreenUpdating = False
'Hide confidential sheet at startup
Call HideSheets
'Activate cell A1 on the Dashboard sheet at startup
With Worksheets("Dashboard")
.Activate
.Range("A1").Select
End With
'Restore screen updates
Application.ScreenUpdating = True
End Sub
Appreciate anyone who can assist me.
Thank so much.