+ Reply to Thread
Results 1 to 8 of 8

VBA code to hide/unhide sheets based on a tick-box (TRUE/FALSE)

  1. #1
    Registered User
    Join Date
    01-10-2013
    Location
    pune
    MS-Off Ver
    Excel 2010
    Posts
    5

    Lightbulb VBA code to hide/unhide sheets based on a tick-box (TRUE/FALSE)

    Hello everyone, this is my first post..

    I had written this code to show/hide worksheets based on check box of worksheet names.
    If the check box corresponding to a sheet says TRUE, the particular sheet is shown whereas the sheet is hidden if it is false.

    Problem: When I open the workbook and select a few sheets (corresponding check boxes) and press the button linked to this code, it works fine (and shows the selected sheets) but on further iterations (when I change the check boxes) it does not work (does not change the visibility of sheets) till I close and reopen the workbook.

    Program:
    Please Login or Register  to view this content.

    Expectation:
    I should be able to refresh the selection and choose a different set of sheets.

    Regards,
    Kavindra
    Last edited by kavindra; 01-10-2013 at 05:09 AM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,406

    Re: VBA code to hide/unhide sheets based on a tick-box (TRUE/FALSE)

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

  3. #3
    Registered User
    Join Date
    01-10-2013
    Location
    pune
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: VBA code to hide/unhide sheets based on a tick-box (TRUE/FALSE)

    Hope that does it.. Thanks for the tip, zbor!

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,406

    Re: VBA code to hide/unhide sheets based on a tick-box (TRUE/FALSE)

    Put on begging of the code that all sheets are visible.

  5. #5
    Registered User
    Join Date
    01-10-2013
    Location
    pune
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: VBA code to hide/unhide sheets based on a tick-box (TRUE/FALSE)

    zbor: I could not understand! Could you elaborate?

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,406

    Re: VBA code to hide/unhide sheets based on a tick-box (TRUE/FALSE)

    Something like this maybe:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    01-10-2013
    Location
    pune
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: VBA code to hide/unhide sheets based on a tick-box (TRUE/FALSE)

    Wow zbor.. just wow! Thanks a lot for the input, it works!!

    If you can tell me how to build up VBA expertise, I'll be really helpful.

  8. #8
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,406

    Re: VBA code to hide/unhide sheets based on a tick-box (TRUE/FALSE)

    Just follow poeple on Forum that give great solutions.
    I do and I learn lot of them (since I'm also newbie in VBA).

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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