+ Reply to Thread
Results 1 to 5 of 5

Toggle hide/unhide multiple non-adjacent columns

  1. #1
    Registered User
    Join Date
    11-18-2019
    Location
    Apple Valley, Minnesota
    MS-Off Ver
    365
    Posts
    20

    Toggle hide/unhide multiple non-adjacent columns

    Hi,

    I need a VBA to allow me to use a toggle button to hide/unhide multiple non-adjacent columns. I have spend the last 2 hours searching this and other sources and trying many macros but none so far have worked (most I have tried don't work at all). However, I have found one that works very well with hiding/unhiding contiguous columns but I have not been able to find the correct syntax to expand this to cover others. For example, this macro clearly hides Cols F and G. In addition to F and G, in my spreadsheet, I want to hide Cols M through P, Col X, and Cols AA through AC.

    Appreciate any help. Thanks in advance.

    VBA code: button to show hide columns

    Please Login or Register  to view this content.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,800

    Re: Toggle hide/unhide multiple non-adjacent columns

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. As you are new, I will do it for you today.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,870

    Re: Toggle hide/unhide multiple non-adjacent columns

    Hi & welcome to the board.
    How about
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    11-18-2019
    Location
    Apple Valley, Minnesota
    MS-Off Ver
    365
    Posts
    20

    Re: Toggle hide/unhide multiple non-adjacent columns

    Brilliant! I love it when the KISS principle is applied. Many, many thanks!

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,870

    Re: Toggle hide/unhide multiple non-adjacent columns

    You're welcome & thanks for the feedback.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Toggle Button, Conditionally Hide/Unhide multiple range of rows
    By danielmaguire in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-24-2020, 06:14 PM
  2. [SOLVED] Toggle Between Hide and Unhide Columns
    By jmklei0 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-04-2020, 11:36 AM
  3. [SOLVED] Toggle (show/hide) non-adjacent columns
    By excel_Noob1234 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-12-2018, 09:26 PM
  4. [SOLVED] Toggle Hide/Unhide Cols & Toggle adj column width
    By anare in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-20-2018, 11:04 AM
  5. button to toggle hide/unhide columns
    By dbuff in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-03-2013, 07:56 PM
  6. Hide/Unhide Multiple Sets of Columns with Toggle Button
    By Mischief433 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-06-2012, 05:55 AM
  7. Hide/unhide non adjacent columns
    By nigelog in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-12-2008, 09:05 AM

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