Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Hiding Sheets

Looking for some input on hiding sheets. I've got a
workbook with about 50 sheets. At any point in time,
what I'd like is to have just 1 sheet visible at a time
(depending what a user selects from a menu). What I've
been using so far is the code below:


Dim wsSheet As Worksheet

For Each wsSheet In Worksheets
wsSheet.Visible = wsSheet.Name = "Sheet1"
Next wsSheet

End Sub

This works, but I'm not sure if this is the best way to
achieve what I want. The thing I don't like about this
method is I see my workbook hiding each sheet
individually for about 5 seconds. Is there a better way
to do this where I woulnd't get that?

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Hiding Sheets

If you set Application.ScreenUpdating = False before the loop and then set
it back to true after the loop you don't see the sheets hiding.

Sue

"Eric" wrote in message
...
Looking for some input on hiding sheets. I've got a
workbook with about 50 sheets. At any point in time,
what I'd like is to have just 1 sheet visible at a time
(depending what a user selects from a menu). What I've
been using so far is the code below:


Dim wsSheet As Worksheet

For Each wsSheet In Worksheets
wsSheet.Visible = wsSheet.Name = "Sheet1"
Next wsSheet

End Sub

This works, but I'm not sure if this is the best way to
achieve what I want. The thing I don't like about this
method is I see my workbook hiding each sheet
individually for about 5 seconds. Is there a better way
to do this where I woulnd't get that?

Thanks!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Hiding Sheets

does setting
Application.ScreenUpdating = False
before the For, help?
-----Original Message-----
Looking for some input on hiding sheets. I've got a
workbook with about 50 sheets. At any point in time,
what I'd like is to have just 1 sheet visible at a time
(depending what a user selects from a menu). What I've
been using so far is the code below:


Dim wsSheet As Worksheet

For Each wsSheet In Worksheets
wsSheet.Visible = wsSheet.Name = "Sheet1"
Next wsSheet

End Sub

This works, but I'm not sure if this is the best way to
achieve what I want. The thing I don't like about this
method is I see my workbook hiding each sheet
individually for about 5 seconds. Is there a better way
to do this where I woulnd't get that?

Thanks!
.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Hiding Sheets

right click on sheet tabview codecopy/paste thisSAVE
Type in your menu (WATCH YOUR SPELLING)
Then just double click on the sheet to goto and hide all other except
Sheet1.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
For Each ws In Worksheets
If ws.Name = "Sheet1" Or ws.Name = Target Then
ws.Visible = True
Else
ws.Visible = False
End If
Next
End Sub

--
Don Guillett
SalesAid Software

"Eric" wrote in message
...
Looking for some input on hiding sheets. I've got a
workbook with about 50 sheets. At any point in time,
what I'd like is to have just 1 sheet visible at a time
(depending what a user selects from a menu). What I've
been using so far is the code below:


Dim wsSheet As Worksheet

For Each wsSheet In Worksheets
wsSheet.Visible = wsSheet.Name = "Sheet1"
Next wsSheet

End Sub

This works, but I'm not sure if this is the best way to
achieve what I want. The thing I don't like about this
method is I see my workbook hiding each sheet
individually for about 5 seconds. Is there a better way
to do this where I woulnd't get that?

Thanks!



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Hiding Sheets

Change to this.......

Sub ScreenUpdate ()

Dim wsSheet As Worksheet

Application.ScreenUpdating = False

For Each wsSheet In Worksheets
wsSheet.Visible = wsSheet.Name = "Sheet1"
Next wsSheet

Application.ScreenUpdating = True

End Sub

"Eric" wrote in message
...
Looking for some input on hiding sheets. I've got a
workbook with about 50 sheets. At any point in time,
what I'd like is to have just 1 sheet visible at a time
(depending what a user selects from a menu). What I've
been using so far is the code below:


Dim wsSheet As Worksheet

For Each wsSheet In Worksheets
wsSheet.Visible = wsSheet.Name = "Sheet1"
Next wsSheet

End Sub

This works, but I'm not sure if this is the best way to
achieve what I want. The thing I don't like about this
method is I see my workbook hiding each sheet
individually for about 5 seconds. Is there a better way
to do this where I woulnd't get that?

Thanks!





----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
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
hiding sheets dstiefe Excel Worksheet Functions 1 October 7th 09 11:42 PM
hiding zero values on all sheets & by default on new sheets WiFiMike2006 Excel Worksheet Functions 4 January 19th 07 08:13 PM
Hiding sheets phil2006 Excel Discussion (Misc queries) 4 August 15th 06 07:20 PM
Locking Sheets / Hiding Sheets Lee Harris Excel Worksheet Functions 4 November 29th 05 07:21 AM
Hiding Sheets Rain Excel Worksheet Functions 10 January 18th 05 08:11 PM


All times are GMT +1. The time now is 09:05 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"