ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Invisible Worksheet - Keeping it Hidden (https://www.excelbanter.com/excel-programming/335375-invisible-worksheet-keeping-hidden.html)

William Benson[_2_]

Invisible Worksheet - Keeping it Hidden
 
I am trying to make a hidden sheet viewable only with a password. Either of
the below approaches are somewhat effective except for one issue: The
"active" cell address in the hidden worksheet displays as "ghosting" in the
upper left corner of the window and the cell formula displays in the formula
bar while Excel waits for the Password. I hate to be so fussy, but I do not
like this!

Is there a more professional method to keep the sheet hidden but allow it to
be unhidden with a password?

Thanks.

'==========Alternative One==============
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Application.ScreenUpdating = False
If Sh.Name = "KeepHidden" Then
Sh.Range("IV65536").Select
If InputBox("Enter Password") < "MyPassword" Then
Sh.Visible = False
End If
End If
Application.ScreenUpdating = True
End Sub


'==========Alternative Two -- Actually fires before Alternative One but the
results are the same ==============
Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
Application.ScreenUpdating = False
If ActiveSheet.Name = "HiddenSheet" Then
If InputBox("Enter Password") < "MyPassword" Then
Sheets("HiddenSheet").Visible = False
End If
End If
Application.ScreenUpdating = True
End Sub



KL

Invisible Worksheet - Keeping it Hidden
 
Hi William,

I would consider something like hiding the sheet (with say
Sheets("Sheet1").Visible=xlSheetVeryHidden) and providing a button (either
on a commmandbar or on the rest of the sheets or maybe a switchboard-type
sheet). The button would ask for a password an unhide the sheet. On
SheetDeactivate event of the restricted sheet I would hide it again.

Regards,
KL


"William Benson" wrote in message
...
I am trying to make a hidden sheet viewable only with a password. Either of
the below approaches are somewhat effective except for one issue: The
"active" cell address in the hidden worksheet displays as "ghosting" in the
upper left corner of the window and the cell formula displays in the
formula bar while Excel waits for the Password. I hate to be so fussy, but
I do not like this!

Is there a more professional method to keep the sheet hidden but allow it
to be unhidden with a password?

Thanks.

'==========Alternative One==============
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Application.ScreenUpdating = False
If Sh.Name = "KeepHidden" Then
Sh.Range("IV65536").Select
If InputBox("Enter Password") < "MyPassword" Then
Sh.Visible = False
End If
End If
Application.ScreenUpdating = True
End Sub


'==========Alternative Two -- Actually fires before Alternative One but
the results are the same ==============
Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
Application.ScreenUpdating = False
If ActiveSheet.Name = "HiddenSheet" Then
If InputBox("Enter Password") < "MyPassword" Then
Sheets("HiddenSheet").Visible = False
End If
End If
Application.ScreenUpdating = True
End Sub




William Benson[_2_]

Invisible Worksheet - Keeping it Hidden
 
Wow, I did not even know about that property. Thank you.


"KL" wrote in message
...
Hi William,

I would consider something like hiding the sheet (with say
Sheets("Sheet1").Visible=xlSheetVeryHidden) and providing a button (either
on a commmandbar or on the rest of the sheets or maybe a switchboard-type
sheet). The button would ask for a password an unhide the sheet. On
SheetDeactivate event of the restricted sheet I would hide it again.

Regards,
KL


"William Benson" wrote in message
...
I am trying to make a hidden sheet viewable only with a password. Either
of the below approaches are somewhat effective except for one issue: The
"active" cell address in the hidden worksheet displays as "ghosting" in
the upper left corner of the window and the cell formula displays in the
formula bar while Excel waits for the Password. I hate to be so fussy, but
I do not like this!

Is there a more professional method to keep the sheet hidden but allow it
to be unhidden with a password?

Thanks.

'==========Alternative One==============
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Application.ScreenUpdating = False
If Sh.Name = "KeepHidden" Then
Sh.Range("IV65536").Select
If InputBox("Enter Password") < "MyPassword" Then
Sh.Visible = False
End If
End If
Application.ScreenUpdating = True
End Sub


'==========Alternative Two -- Actually fires before Alternative One but
the results are the same ==============
Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
Application.ScreenUpdating = False
If ActiveSheet.Name = "HiddenSheet" Then
If InputBox("Enter Password") < "MyPassword" Then
Sheets("HiddenSheet").Visible = False
End If
End If
Application.ScreenUpdating = True
End Sub






William Benson[_2_]

Invisible Worksheet - Keeping it Hidden
 
The property setting, I meant, not the property.

"William Benson" wrote in message
...
Wow, I did not even know about that property. Thank you.


"KL" wrote in message
...
Hi William,

I would consider something like hiding the sheet (with say
Sheets("Sheet1").Visible=xlSheetVeryHidden) and providing a button
(either on a commmandbar or on the rest of the sheets or maybe a
switchboard-type sheet). The button would ask for a password an unhide
the sheet. On SheetDeactivate event of the restricted sheet I would hide
it again.

Regards,
KL


"William Benson" wrote in message
...
I am trying to make a hidden sheet viewable only with a password. Either
of the below approaches are somewhat effective except for one issue: The
"active" cell address in the hidden worksheet displays as "ghosting" in
the upper left corner of the window and the cell formula displays in the
formula bar while Excel waits for the Password. I hate to be so fussy,
but I do not like this!

Is there a more professional method to keep the sheet hidden but allow
it to be unhidden with a password?

Thanks.

'==========Alternative One==============
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Application.ScreenUpdating = False
If Sh.Name = "KeepHidden" Then
Sh.Range("IV65536").Select
If InputBox("Enter Password") < "MyPassword" Then
Sh.Visible = False
End If
End If
Application.ScreenUpdating = True
End Sub


'==========Alternative Two -- Actually fires before Alternative One but
the results are the same ==============
Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
Application.ScreenUpdating = False
If ActiveSheet.Name = "HiddenSheet" Then
If InputBox("Enter Password") < "MyPassword" Then
Sheets("HiddenSheet").Visible = False
End If
End If
Application.ScreenUpdating = True
End Sub









All times are GMT +1. The time now is 02:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com