+ Reply to Thread
Results 1 to 5 of 5

Hide Column Based on ListBox Selection

  1. #1
    Registered User
    Join Date
    05-08-2013
    Location
    charlotte,usa
    MS-Off Ver
    Excel 2007
    Posts
    3

    Hide Column Based on ListBox Selection

    Hi,
    My data is in columns and each column may contain different year, such as 2011,2012,2013 and etc. I am trying to create a ListBox so I can make a selection or multiple selections and hide columns based on my selection.

    Can anyone help!

    Thanks,

  2. #2
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Hide Column Based on ListBox Selection

    I'm assuming you know how to populate and setup an ActiveX multiselect listbox

    The following code will hide/unhide the columns base on the listbox selection
    Please Login or Register  to view this content.
    Elegant Simplicity............. Not Always

  3. #3
    Registered User
    Join Date
    05-08-2013
    Location
    charlotte,usa
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Hide Column Based on ListBox Selection

    Thank you! I will try and let you know.

  4. #4
    Registered User
    Join Date
    05-08-2013
    Location
    charlotte,usa
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Hide Column Based on ListBox Selection

    Andy - I tried the code but I got the following error. Run-time error '424' Object required. Do you know what may cause this?

  5. #5
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Hide Column Based on ListBox Selection

    Hey sarperb

    things you may need to adjust within the code are shown in red

    Please Login or Register  to view this content.
    Also...... the sub and function need to sit in a code module not a sheet module...

+ 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