+ Reply to Thread
Results 1 to 10 of 10

Auto hide worksheets from cell data input.

  1. #1
    Registered User
    Join Date
    09-24-2011
    Location
    Lincolnshire
    MS-Off Ver
    Excel 2003
    Posts
    4

    Cool Auto hide worksheets from cell data input.

    Hi All
    I’m after a way to auto hide a single worksheet (ExVal1) once either of two cells (H78 or I78) within that sheet has a value greater than 0. I would prefer the sheet to be hidden on the next opening of the workbook itself.
    I have two systems, one running excel 2003, the other 2007, I need this to work on both systems
    I’ve searched the forum for a number of hours and found a multitude of almost close answers but the VBA formulas are so different I get lost. I’m new to Excel but learning fast and VBA is an area in which I wish to develop.

    Can anyone help?

    Regs
    Al Z
    Last edited by alzictorini; 09-25-2011 at 07:25 AM.

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: VBA Help

    Hello, and welcome to the forum. Yes, it's not that difficult, but before anybody can help you you need to read the forum rules, specifically rule #1, which says that threads must have a descriptive subject, and not be general requests for help.

    You read the rules, edit your post to change the title and, by the time you've done that I'll have your macro for you.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,539

    Re: VBA Help

    Welcome to the forum.

    Please take a few moments to read the forum rules and then modify your thread title.

    It is often the case that a sample workbook will help clarify your requirement, for example the structure of the workbook, which sheet to be hidden, which sheet contains the cells to be checked, and so on.

    It sounds as though you require a Workbook Open event which will check the two cells and, if the criterion is met, will hide the sheet. You must have at least one sheet visible.

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    MS365 V.2406
    Posts
    2,312

    Re: VBA Help

    Try this bit of code in under ThisWorkbook...
    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: VBA Help

    Dangelor - could you also read the forum rules, please, and not post to threads where a title change has been requested.

  6. #6
    Registered User
    Join Date
    09-24-2011
    Location
    Lincolnshire
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Auto hide worksheets from cell data input.

    Hello all

    OK, post name amended! Sorry members, please feel free to dis the new guy I was in such a flap last night.
    dangelo, I've used the code but initially the sheet was still visible, I did notice a warning at the top of the page stating that macros was not enabled. I opened the warning and enabled macros and the sheet instantly hid, great. Is there a way though to keep macros enabled all the time or can it be asked before the workbook is opened? I've now progressed and added another 11 sheets (ExVal2-ExVal12). How do I adjust the code some the same criteria is valid for each sheet? I do have a master sheet still visible (Course Details). I would like the workbook to always open on the Course details worksheet also?

    Thanks for the guidance to all partaking in my project.

    Regs
    AlZ
    Last edited by alzictorini; 09-25-2011 at 08:29 AM.

  7. #7
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Auto hide worksheets from cell data input.

    You can make this work on all of the other ExVal sheets using the following code:

    Please Login or Register  to view this content.

    Please note, if you want rather than setting the visible property to False, you can set it to xlVeryHidden, which means that the sheet can only be unhidden using another macro, not manually unhidden by the user.

  8. #8
    Registered User
    Join Date
    09-24-2011
    Location
    Lincolnshire
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Auto hide worksheets from cell data input.

    Ladies & Gents

    That’s the one, I've managed to get the item to open on the correct sheet also, thanks for all your help. You are all very knowledgeable.

    Regs

    AlZ
    Last edited by alzictorini; 09-25-2011 at 04:02 PM.

  9. #9
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    MS365 V.2406
    Posts
    2,312

    Re: Auto hide worksheets from cell data input.

    In XL2003, look under Tools>Options>Security tab>Macro Security... and choose the level of security you wish.

    HTH -Rich

  10. #10
    Registered User
    Join Date
    09-24-2011
    Location
    Lincolnshire
    MS-Off Ver
    Excel 2003
    Posts
    4

    Thumbs up Re: Auto hide worksheets from cell data input.

    I've updated and run the 2003 version now, all working fine.

    Thanks for all the help guys

    AlZ

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1