Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Hide Show Shts

SIGE,

Maybe...
At least one worksheet must be visible in an Excel workbook at all times.
Try making Sheet5.Visible then running the loop.

Jim Cone
San Francisco, USA


"SIGE" wrote in message
om...
Hi There,
I've 3 sheets:
sheet1: to view when pwd OK
sheet5: INFOsheet, to show when macros disabled
sheet6: Sheet with PARAMETERS
*Sheet 6 has to be remain hidden at all times...!
But I run into an error on the Sub HideAll()at line:
'@@@@****
wsSheet.Visible = xlSheetVeryHidden
'@@@@@*****
*I still see Sheet5 when running ShowAll ()!
Can anyone see what is wrong????
On Open workbook I run sub ShowAll()
On Close WBK i run Sub HideAll()


Sub HideAll()
Application.ScreenUpdating = False
For Each wsSheet In ThisWorkbook.Worksheets
If wsSheet.CodeName = "Sheet5" Then
wsSheet.Visible = xlSheetVisible
Else
'@@@@****
wsSheet.Visible = xlSheetVeryHidden
'@@@@@*****
End If
Next wsSheet
Application.ScreenUpdating = True
End Sub


Sub ShowAll()
bIsClosing = False
Application.ScreenUpdating = False
For Each wsSheet In ThisWorkbook.Worksheets
If wsSheet.CodeName < "Sheet5" Or wsSheet.CodeName < "Sheet6" Then
wsSheet.Visible = xlSheetVisible
End If
Next wsSheet
Application.ScreenUpdating = True
Application.ScreenUpdating = False
Sheet5.Visible = xlSheetVeryHidden
Sheet6.Visible = xlSheetVeryHidden
Application.ScreenUpdating = True
End Sub

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VLOOKUP using the act shts tab name as a reference for the table_a timmulla Excel Discussion (Misc queries) 1 July 23rd 07 04:56 PM
How to Compare Rows on 2 shts .... Les Wegg Excel Discussion (Misc queries) 0 May 11th 05 03:25 PM
newbie ?: set variables, different shts, equal to each other terry b Excel Programming 11 February 28th 05 09:24 AM
Summary...Number of shts varies steveh[_2_] Excel Programming 2 December 11th 03 08:46 PM
Copying shts from one wbk to another jacqui[_2_] Excel Programming 2 July 25th 03 04:50 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"