+ Reply to Thread
Results 1 to 8 of 8

Hide colums based on drop down list

  1. #1
    Registered User
    Join Date
    04-10-2016
    Location
    Christchurch, New Zealand
    MS-Off Ver
    2010
    Posts
    16

    Question Hide colums based on drop down list

    Hi all

    I have a sheet with a drop down list in cell B2. This contains Locations.

    When a location is selected in the list, I want it to show only columns that have that location in row 6.

    Can anyone help me - I've done a lot of searching, however most examples search all the information in the whole sheet, not just the one row.

    Thanks in advance!


    Anna

  2. #2
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: Hide colums based on drop down list

    Maybe put in the worksheet module this and see if it does what you want.
    shrink the range "A6:ZZ6" if it is hiding too many cells.


    Please Login or Register  to view this content.
    If you want something done right... find a forum and ask an online expert.

    Time flies like an arrow. Fruit flies like a banana.

  3. #3
    Registered User
    Join Date
    04-10-2016
    Location
    Christchurch, New Zealand
    MS-Off Ver
    2010
    Posts
    16

    Re: Hide colums based on drop down list

    Great that works thanks! My only thing is that I have the location in a merged cell in the row (spans over 2 columns), I want both the columns to show, but it's just picking up the one?

    Also - how would I do a clear all button? or show all?

  4. #4
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: Hide colums based on drop down list

    try this
    as to show all - you can select all the cells (the square just diagonal up to the left of A1) and right click unhide if you want... it doesn't get a lot easier than that.

    Please Login or Register  to view this content.
    Last edited by scottiex; 05-24-2018 at 09:17 PM.

  5. #5
    Registered User
    Join Date
    04-10-2016
    Location
    Christchurch, New Zealand
    MS-Off Ver
    2010
    Posts
    16

    Re: Hide colums based on drop down list

    Thanks again.... I had this working - and now it's not... I've attached the file. (I think?)

    I understand how the columns can be unhidden, however this is for users with little to know knowledge of excel.

    In the end I will be locking down the cells so they can enter information in only the 'Hour Meter readings'.

    I've added an all to the Location drop down list, but haven't got the functionality sorted yet.

    My end goal for this is so that each user can select their Location, and maybe then different paramaters too (hoist type). and then there will totals / averages columns just that add up the weekly hours for each fleet no depending on the paramaters that have been set.

    Am I going about this the right way?

    Thanks again for your time!
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: Hide colums based on drop down list

    looks like you are working with row 9 and yu moved the dropdown to A3
    You could get it to do the hoist type too I guess. but will there be so many hoists that it needs to be filtered like that?

    Is there a chance of typos causing this to not work?
    normally we would use numbers not names to reduce that chance.


    try this - if you want to show everything just select blank for A3

    Please Login or Register  to view this content.
    Last edited by scottiex; 05-24-2018 at 10:46 PM.

  7. #7
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: Hide colums based on drop down list

    try this for the solution to the second part of your request
    this time I used your "All" to signify you want All fields.


    Please Login or Register  to view this content.
    Last edited by scottiex; 05-24-2018 at 11:13 PM.

  8. #8
    Registered User
    Join Date
    04-10-2016
    Location
    Christchurch, New Zealand
    MS-Off Ver
    2010
    Posts
    16

    Re: Hide colums based on drop down list

    Thanks again Scottiex.

    This is working great. However its working when both selection drop down boxes have a selection, but if the location (A3) is All, and then the second one A6 has a selection, it does not hide the columns.

    It's possible there maybe a need to add in further search / display criterias to, how would I update the code so that any of the drop down boxes would change the displayed columns?

    THanks again for your help with this.

+ 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 rows based on drop down list
    By PvtJoker in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-13-2017, 04:11 PM
  2. Hide rows based on drop down list
    By soco3594 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-12-2017, 09:08 PM
  3. Hide/Unhide Sheets based on drop down list
    By toci in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-01-2016, 08:06 AM
  4. [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
  5. Hide/Unhide cells based on drop-down list
    By Savvy25 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-08-2014, 02:36 AM
  6. Hide/unhide columns based on the drop down list value
    By vagif in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-16-2012, 02:13 AM
  7. Hide Rows based on Client Drop Down List
    By troyhalsey in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-26-2012, 07:28 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