+ Reply to Thread
Results 1 to 8 of 8

Hide and unhide columns in excel with toggle button

  1. #1
    Registered User
    Join Date
    03-26-2024
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    15

    Hide and unhide columns in excel with toggle button

    Hi,

    I am trying to hide and unhide several columns and all of them are not adjacent to each other. I made this code (see below) work for column F to I, and I have also tried to use the "Range" for several (not adjacent) columns and it worked, but when pressing the toggle button they did not appear again. How do I implement the "Range" command to work with this code? Or is there any other code i can use to make it work? I need to hide and unhide with one toggle button columns F to I, O to V and X.

    Please Login or Register  to view this content.
    Thanks for your time if you are able to help. It is much appreciated.
    Last edited by jeffreybrown; 03-26-2024 at 10:21 AM. Reason: Please use code tags!

  2. #2
    Valued Forum Contributor
    Join Date
    12-30-2020
    Location
    Odessa / Ukraine
    MS-Off Ver
    2021
    Posts
    301

    Re: Hide and unhide columns in excel with toggle button

    Hi @MetteKvidal. Try.
    NOTE: As the original poster/owner, only you can mark your thread as SOLVED (Thread Tools above Post #1).
    You can say "Thanks" in your thread to everyone who offered to help you.
    You can also reward them by clicking * "Add Reputation" under their username on the left.
    With Regards, MikeVol.

  3. #3
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    1,980

    Re: Hide and unhide columns in excel with toggle button

    Maybe

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    03-26-2024
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    15

    Re: Hide and unhide columns in excel with toggle button

    Thank you so much for your post and example. This only hides F to I and not the rest, so unfortunately I'm still where i was with my own code. But thanks anyway :D

  5. #5
    Registered User
    Join Date
    03-26-2024
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    15

    Re: Hide and unhide columns in excel with toggle button

    YES! This seems to work! Thank you so very much!

    Highly appreciate your help :D

  6. #6
    Registered User
    Join Date
    03-26-2024
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    15

    Re: Hide and unhide columns in excel with toggle button

    This worked perfect, but for the next step I wanted to use several toggle buttons in the same excel sheet. Tried to add another toggle button and address this with same code, and only replaced columns I wanted to hide, but this doen't work. Only the toggle button 1 works. Is there a work around to make this work? (I made sure to add the same code to button 2 btw.)

    Thanks again for your help :D
    Last edited by jeffreybrown; 03-26-2024 at 10:22 AM. Reason: Please do not quote full posts!

  7. #7
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    1,980

    Re: Hide and unhide columns in excel with toggle button

    (I made sure to add the same code to button 2
    Did you change this part to reference the correct button?
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    03-26-2024
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    15

    Re: Hide and unhide columns in excel with toggle button

    *Blush* No, I didn't. It works! Thanks a lot <3
    Last edited by jeffreybrown; 03-26-2024 at 10:22 AM. Reason: Please do not quote full posts!

+ 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. [SOLVED] Toggle Button to hide/unhide rows based on value
    By therealaccountant in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-26-2019, 12:40 PM
  2. Toggle Button to hide unhide sheets
    By 95marine in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-14-2017, 04:46 PM
  3. [SOLVED] Toggle Button to hide/unhide rows based on value
    By goomblar in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-03-2014, 07:35 AM
  4. button to toggle hide/unhide columns
    By dbuff in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-03-2013, 07:56 PM
  5. 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
  6. Using Toggle Button to hide/unhide rows that may change
    By jmpatrick in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-09-2011, 09:48 AM
  7. How to HIDE/UNHIDE Specific Sheets Using a TOGGLE Button?
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 04-16-2011, 02:58 AM

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