Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel: Hiding Worksheets in an Excel File 2

Status
Not open for further replies.

Hasit

IS-IT--Management
Sep 13, 2001
1,061
GB
I have around 7 worksheets in a single Excel file. Is there a way to hide 6 of the 7 worksheets and only have 1 worksheet visible?

Thanks!
 
Yup - select 6 sheets
Goto Format>Sheet>Hide
I'm assuming there is more to it than that....is there any kind of indicator as to what sheet not to hide ??
Does this need to be automated ??

Rgds
Geoff
Si hoc legere scis, nimis eruditionis habes
 
Geoff, 2 things. First, thanks for the response, went paintballing over the weekend, and I was hit in the head a couple of times (in case you are interested I got him back!). I am still suffering, so believe it or not, I could not find "SHEET/HIDE".

Second, yes, we will need to automagically hide and unhide the same sheets (i.e. make the same sheet visible all the time), but periodically unhide the other sheets, so we can review and update the content. The rules are being worked out at the moment. My question was really related to the second point.

So, if you have any ideas (I am assuming this will have to be VBA related, or some sort of recorded macro), I would be grateful.
 
Well you can iterate thru the worksheets collection:

For each sht in thisworkbook.worksheets
if sht.name <> &quot;Master&quot; then
sht.visible = false
else
end if
next

this would hide all sheets except a sheet called &quot;MASTER&quot;

Rgds
Geoff
Si hoc legere scis, nimis eruditionis habes
 
Hey hazit,

Just to piggy-back on Geoff's response, simply hiding a sheet may not make it as invisible as you might like. The Visible property has 3 values ...

xlSheetVisible
xlSheetHidden
xlSheetVeryHidden

The hidden value still allows users to know that there is/are sheet(s) and can be hidden/unhidden from the menu.

The very hidden value ONLY permits unhiding via code or from the Project Worksheet Properties window.

Just thot I'd add this caveat. :)

Skip,
Skip@TheOfficeExperts.com
 
Geoff, thanks for the pointer. And Skip: I did not know about the 3 versions of hidden.

Thanks again for your help.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top