hide all sheets

Posted on 2011-02-23
Last Modified: 2012-05-11

Im trying to hide all sheets and its not quite working

Dim objSht
For Each objSht In ActiveWorkbook.Sheets
      objSht.Hidden = xlSheetHidden
   Next objSht
Can anyone amend?

Question by:Seamus2626
LVL 47

Expert Comment

by:Wayne Taylor (webtubbs)
ID: 34960320
You can't hide *all* sheets, as there must always be one visible at any one time.

Accepted Solution

pdd1lan earned 500 total points
ID: 34960346
you can hide sheets, but you need to leave one open.

Dim objSht
For Each objSht In ActiveWorkbook.Sheets
    If objSht.Name <> "Sheet3" Then
      objSht.Visible = xlSheetVeryHidden
    End If

   Next objSht

Author Closing Comment

ID: 34960422
Thats what i need, thanks

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now