+ Reply to Thread
Results 1 to 5 of 5

Hide and Show Colums using VBA

  1. #1
    Registered User
    Join Date
    04-09-2016
    Location
    London,England
    MS-Off Ver
    2010
    Posts
    10

    Hide and Show Colums using VBA

    Hi

    Can you tell me a VBA Code where I can Hide and Show using a button different columns within a sheet. So as the user presses Hide the columns will be hidden and vice versa for the show.

    Regards

  2. #2
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,526

    Re: Hide and Show Colums using VBA

    Hi Aisha890:

    Have a look at these:

    Please Login or Register  to view this content.
    Regards,

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  3. #3
    Registered User
    Join Date
    04-09-2016
    Location
    London,England
    MS-Off Ver
    2010
    Posts
    10

    Re: Hide and Show Colums using VBA

    Please Login or Register  to view this content.

    and for show

    Please Login or Register  to view this content.


    However it shows the code as in break mode

  4. #4
    Registered User
    Join Date
    04-09-2016
    Location
    London,England
    MS-Off Ver
    2010
    Posts
    10

    Re: Hide and Show Colums using VBA

    I need a code where in columns K and M wherever there is date. Upon clicking the hide button it will hide and show for the vice versa.

    Also when I try to connect it with the button by altering the code from the view code option. It takes me to the code instead of performing the actions. Please tell me how to resolve it.
    Last edited by Aisha890; 04-19-2016 at 04:31 AM.

  5. #5
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,526

    Re: Hide and Show Colums using VBA

    This code will hide your desired columns if they're not hidden or show them if they're hidden:

    Please Login or Register  to view this content.
    If the code is going into break mode I'm guessing there's a syntax error with it. I've tested mine and there's no issue.

    Regards,

    Robert

+ 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] Hide/Show Colums via drop down list on a different sheet
    By realrookie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-24-2015, 05:52 AM
  2. Macro to hide colums
    By mohk123 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-24-2013, 01:04 AM
  3. [SOLVED] Hide non ajacent colums with a Macro
    By Shazz in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-01-2013, 09:54 AM
  4. freeze first colums and hide one colums
    By pejoi in forum Excel General
    Replies: 2
    Last Post: 08-09-2012, 03:50 AM
  5. Hide show colums showing list of works
    By excelwanabe in forum Excel General
    Replies: 9
    Last Post: 02-21-2012, 09:24 AM
  6. Macro to Hide Colums
    By keen learner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-08-2006, 08:10 AM
  7. How can I hide data in colums.
    By Gord in forum Excel General
    Replies: 4
    Last Post: 06-01-2005, 04:05 PM

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