• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Auto Hide All Inactive Sheets, and Then Display When Active

Is it possible to hide all inactive sheets (by inactive I mean if nothing is happening on the sheet), and then to display those sheets in the event that any code refers to it?


I have these:

Sheet1.Visible = xlSheetVeryHidden

Sheet2.Visible = xlSheetVisible


But I was wondering if it were possible to do some kind of auto hide auto display based on the activity of any specific code ran on the whole workbook?
 
You can add worksheet change events to each worksheet and make them visible upon change. But this might quickly degenerate in to all sheets becoming visible.


I have no idea how we can determine when a sheet is inactive.
 
Indi


As Chandoo has said you can add the code you have to a Worksheet Change event

You need to define when and how a sheet is active ?
 
@ both Chandoo & Hui


Yes that sounds about right. The worksheet change is going to be basically when the worksheet's called (via Macro). Just trying to figure that part out for now.


As for the event, the event will hide all other pages... until the next sheet is called,.. which would then hide all other pages...


so on and so forth and hopefully I might be able to achieve this auto toggle visibility thing.


All in all, I just have 5 worksheets with a lot of stuff going on at different times, and I would like everything to look a little more clean organized with simply one sheet visible.


Thanks guys I'm working on that worksheet change event tweak now.
 
India

Add your lines to show/hide the pages to the

Worksheet_activate and worksheet_deactivate events
 
i have the same problem with what you discuss, but how to work with it if i have less knowledge about the codes? Some available tools?
 
luckily i found that the add-in kutools for excel is quite fit for me. It generate most of the useful tools to free from time-consuming operations.
 
i would like to hide all the inactive worksheets, and the problem is that i have dozens of sheets to deal with and have no knowledge about the macros or vb scripts. what a pity. maybe i should look for some available tools to help.
 
Back
Top