+ Reply to Thread
Results 1 to 4 of 4

Hiding columns based on cell value (ListBox)

  1. #1
    Registered User
    Join Date
    03-29-2010
    Location
    Kyle, Texas
    MS-Off Ver
    Excel 2010
    Posts
    33

    Hiding columns based on cell value (ListBox)

    I have been digging through the forums and can't find what I am looking for.

    I have a very large spreadsheet (Columns A:AK right now...still growing) and I would like to hide columns based on my selection from a ListBox I have in place. Is this possible?

    I have already created Macros that will do this, but I can't assign buttons because when you hide the columns you can't see the button to unhide the columns again. :/

    My ListBox has the names:
    HideRevenue
    ShowRevenue
    HideMax
    ShowMax
    HideVolume
    ShowVolume

    The columns I would like to hide/unhide with each selection are:
    Revenue = I:L
    Max = M:S
    Volume = T,X:Z,AF

    I am not new to Excel, but I am new to VBA which is what I have been trying to use to make this happen. I'm sure there is a way, but can't find it or figure it out on my own.

    Thanks for the help.
    Last edited by Big_Tater; 04-16-2013 at 10:45 PM.
    David

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Hiding columns based on cell value (ListBox)

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  3. #3
    Valued Forum Contributor
    Join Date
    11-20-2012
    Location
    Seattle, WA USA
    MS-Off Ver
    Excel 2010
    Posts
    597

    Re: Hiding columns based on cell value (ListBox)

    you can, when you put the button in right click it, go to format controls, Properties tab, select don't move or size with cells
    also you could put the buttons all in the A column since you are hiding columns, then they will never disappear

    otherwise you can use something like this on the actual sheet (double click the sheet in the VBA editor):

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    03-29-2010
    Location
    Kyle, Texas
    MS-Off Ver
    Excel 2010
    Posts
    33

    Re: Hiding columns based on cell value (ListBox)

    scott.s that did the trick! Thanks so much for the help! With a few modifications it did exactly what I was looking for.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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