ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hide a Sheet Q (https://www.excelbanter.com/excel-programming/382203-hide-sheet-q.html)

Sean

Hide a Sheet Q
 
I thought the XLVeryhidden function hides a sheet from been unhidden
via Format-Sheet-Unhide and could only be unhidden via code.

Does the Workbook or Sheet have to be protected also?

Thanks


NickHK

Hide a Sheet Q
 
Sean,
With this code and no Protection:

Private Sub CommandButton1_Click()
Worksheets(2).Visible = xlVeryHidden
Worksheets(3).Visible = xlHidden
End Sub

I only see Worksheet 3 in the list of FormatSheetUnhide.

I the use run suitable code, then can unhide Worksheet 3 though.

NickHK

"Sean" wrote in message
ups.com...
I thought the XLVeryhidden function hides a sheet from been unhidden
via Format-Sheet-Unhide and could only be unhidden via code.

Does the Workbook or Sheet have to be protected also?

Thanks




NickHK

Hide a Sheet Q
 
That should read:
"If the user runs suitable code, they can unhide Worksheet 2 though."

NickHK

"NickHK" wrote in message
...
Sean,
With this code and no Protection:

Private Sub CommandButton1_Click()
Worksheets(2).Visible = xlVeryHidden
Worksheets(3).Visible = xlHidden
End Sub

I only see Worksheet 3 in the list of FormatSheetUnhide.

I the use run suitable code, then can unhide Worksheet 3 though.

NickHK

"Sean" wrote in message
ups.com...
I thought the XLVeryhidden function hides a sheet from been unhidden
via Format-Sheet-Unhide and could only be unhidden via code.

Does the Workbook or Sheet have to be protected also?

Thanks






Sean

Hide a Sheet Q
 
Thanks Nick

I had this code for Worksheet open

Worksheets(1).Visible = False

Having already xlVeryhidden all sheets except for one when closing.
When I opened the worksheet was not aware that the above would overide
and hence not be visible but show the sheet in Format-Sheet-Unhide


On Jan 30, 8:31 am, "NickHK" wrote:
Sean,
With this code and no Protection:

Private Sub CommandButton1_Click()
Worksheets(2).Visible = xlVeryHidden
Worksheets(3).Visible = xlHidden
End Sub

I only see Worksheet 3 in the list of FormatSheetUnhide.

I the use run suitable code, then can unhide Worksheet 3 though.

NickHK

"Sean" wrote in oglegroups.com...



I thought the XLVeryhidden function hides a sheet from been unhidden
via Format-Sheet-Unhide and could only be unhidden via code.


Does the Workbook or Sheet have to be protected also?


Thanks- Hide quoted text -- Show quoted text -



NickHK

Hide a Sheet Q
 
Sean,
Checking the values of the settings in the Immediate window gives:

?xlsheethidden
0
?xlsheetveryhidden
2
?xlSheetVisible
-1

So you can see the 2 lines of code are exactly the same:
Worksheets(1).Visible = False
Worksheets(1).Visible = xlSheetHidden

NickHK

"Sean" wrote in message
ps.com...
Thanks Nick

I had this code for Worksheet open

Worksheets(1).Visible = False

Having already xlVeryhidden all sheets except for one when closing.
When I opened the worksheet was not aware that the above would overide
and hence not be visible but show the sheet in Format-Sheet-Unhide


On Jan 30, 8:31 am, "NickHK" wrote:
Sean,
With this code and no Protection:

Private Sub CommandButton1_Click()
Worksheets(2).Visible = xlVeryHidden
Worksheets(3).Visible = xlHidden
End Sub

I only see Worksheet 3 in the list of FormatSheetUnhide.

I the use run suitable code, then can unhide Worksheet 3 though.

NickHK

"Sean" wrote in

oglegroups.com...



I thought the XLVeryhidden function hides a sheet from been unhidden
via Format-Sheet-Unhide and could only be unhidden via code.


Does the Workbook or Sheet have to be protected also?


Thanks- Hide quoted text -- Show quoted text -






All times are GMT +1. The time now is 08:05 AM.

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