Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / December 2006

Tip: Looking for answers? Try searching our database.

Hide unhide sheets

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Reijer - 17 Dec 2006 19:53 GMT
Hello Excellers,

With a value in cel B23 on every sheet i want to hide or unhide the sheets.
Standard they are hidden when i start. Who can help me with a procedure for
this pls?

Greetings,

Reijer.
Martin Fishlock - 18 Dec 2006 02:04 GMT
Reijer:

You can hide/unhide sheets with the following VBA command

activesheet.visible=true/false.

So to go thru all the worksheets in a workbook and check depending on if
there is a value in B23:

Option Explicit

Sub CheckAllWorksheets()

Dim ws As Worksheet

For Each ws In ActiveWorkbook.Worksheets
   If ws.Range("B23").Value <> "" Then
       ws.Visible = xlSheetVisible
   Else
       ws.Visible = xlSheetHidden
   End If
Next ws

End Sub

Signature

Hope this helps
Martin Fishlock
Please do not forget to rate this reply.

> Hello Excellers,
>
[quoted text clipped - 5 lines]
>
> Reijer.
Reijer - 18 Dec 2006 14:38 GMT
I'll try this out Martin,

Thanks for your reaction.
> Hello Excellers,
>
[quoted text clipped - 5 lines]
>
> Reijer.

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.