+ Reply to Thread
Results 1 to 5 of 5

Simultaneously Hide and Unhide Different Columns

  1. #1
    Forum Contributor
    Join Date
    06-21-2010
    Location
    -
    MS-Off Ver
    Excel 2010
    Posts
    1,211

    Simultaneously Hide and Unhide Different Columns

    I'm using this code to 'Hide' and 'Unhide' a series of grouped columns, using a toggle button...

    Please Login or Register  to view this content.
    However, I want to be able to simultaneously hide one group whilst showing another group, e.g., when the toggle button is pressed, hide Range G:G and show Range L:L and vice versa, when the button is pressed again.

    What additional line/s of code are required to achieve this?

    Many thanks...

  2. #2
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    Re: Simultaneously Hide and Unhide Different Columns

    Something like...

    Please Login or Register  to view this content.
    Perhaps it was the Noid who should have avoided me...
    If you are satisfied with my solution click the small star icon on the left. Thanks
    1. Make a copy of your workbook and run the following code on your copy (just in case)
    2. With excel open, press ALT+F11 to open the Visual Basic Editor (VBE). From the "Insert" menu, select "Module".
    3. Paste the code from above into the empty white space. Close the VBE.
    4. From the developer tab, choose "Macros", select the Sub Name, and click "Run".

  3. #3
    Forum Contributor
    Join Date
    06-21-2010
    Location
    -
    MS-Off Ver
    Excel 2010
    Posts
    1,211

    Re: Simultaneously Hide and Unhide Different Columns

    AlvaroSiza,

    Many thanks for that, it works perfectly, however, within the second range of columns, I have a 'combo box' and this always remains visible, even when the columns containing it are hidden.

    Do you know if there is any code that could be added to also hide/show the combo box? I'm a VBA novice, hence the question.

    Many thanks...

  4. #4
    Forum Contributor
    Join Date
    06-21-2010
    Location
    -
    MS-Off Ver
    Excel 2010
    Posts
    1,211

    Re: Simultaneously Hide and Unhide Different Columns

    AlvaroSiza,

    Okay, ignore that last question, I figured it out...

    I simply added ActiveSheet.Shapes("Drop Down 18").Visible = True

    Many thanks for your help, once again...

  5. #5
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    Re: Simultaneously Hide and Unhide Different Columns

    You bet and glad you got the other part figured out.

    -as-

+ 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