+ Reply to Thread
Results 1 to 5 of 5

"VBA code to hide/show rows based on multiple selection of drop down list.

  1. #1
    Registered User
    Join Date
    01-09-2020
    Location
    Canada
    MS-Off Ver
    Excel Version 1912 (Build 12325.20344 Microsoft Store)
    Posts
    36

    "VBA code to hide/show rows based on multiple selection of drop down list.

    Hi All,

    Relatively new to VBA stuff in Excel, kind of have things figured out but this is beyond what I can figure out. In short, I currently have a code that will "hide/show" lines/columns based on a cell selection made. Works great (thanks to the folks that helped me tweak that that). If a cell value is "yes", then it shows the rows, if a cell value is "no" then it keeps the rows hidden. What I am trying to accomplish now is if there is a way to "rewrite" the code based on multiple list values (no repetition). Example: User can choose multiple items from a drop down list of values at the same time, example: multiple list could have values to select of "Select One", "None", "1", "2", "3", "4", "5". They can select as many items from the list that they need. IE: If the default is "Select One" then no rows show, If "None" is selected then again no rows will show. If they select only "1" from the multiple list values then row 10 will show. If they select "1, 3, 5" from the multiple list value then rows 10, 12 and 14 will show. If possible I also need to set it up so that if "Select One" or "None" are selected along with "1" (or any other value in the list) that it still has the rows hidden so there isn't an "error". Any help would be greatly appreciated. (as a side note, I am hoping that I can add "multiple" drop down lists on the same sheet that will do the same thing. IE: second drop down list could have apple, banana, orange etc. and it too would show rows 18, 24, 46 (as an example) on the same sheet based on those different ranges/selections. ))

    Hope that makes sense. Thanks in advance to all.

    Current code is below (yes there is a lot of lines that I need to hide/show...not fun on my end but if I can get it to work with one "range" I should be able to duplicate it over the ranges that I need )


    Please Login or Register  to view this content.
    [code]
    Last edited by Pepe Le Mokko; 02-02-2020 at 04:41 PM.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,453

    Re: "VBA code to hide/show rows based on multiple selection of drop down list.

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    I did it for you this time. Please read forum rules. Thanks

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,453

    Re: "VBA code to hide/show rows based on multiple selection of drop down list.

    Administrative note
    Please update your profile as necessary to properly reflect the exact version(s) of Excel your question relates to. Members tailor answers based on your Excel version. Your profile does not indicate your version.
    Thanks

  4. #4
    Registered User
    Join Date
    01-09-2020
    Location
    Canada
    MS-Off Ver
    Excel Version 1912 (Build 12325.20344 Microsoft Store)
    Posts
    36

    Re: "VBA code to hide/show rows based on multiple selection of drop down list.

    Thanks Pepe,

    My apologies, thought I did it correctly. Thanks for doing that for me, I now understand how things should be posted. Thanks again for your assistance .

  5. #5
    Registered User
    Join Date
    01-09-2020
    Location
    Canada
    MS-Off Ver
    Excel Version 1912 (Build 12325.20344 Microsoft Store)
    Posts
    36

    Re: "VBA code to hide/show rows based on multiple selection of drop down list.

    Have updated my version as well. Thanks again

+ 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 Multiple Rows Based on Drop Down Menu Selection
    By leebird in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-16-2018, 07:52 AM
  2. Hide Multiple Rows Based on Drop Down Menu Selection
    By leebird in forum Excel General
    Replies: 1
    Last Post: 02-16-2018, 03:28 AM
  3. [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
  4. Replies: 1
    Last Post: 06-25-2015, 07:29 AM
  5. Macro to hide/show rows based on Drop Down selection
    By Bleucherie in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 03-03-2015, 06:14 PM
  6. Hide-Unhide rows on multiple worksheets based on value of a drop down list
    By clo2peter in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-10-2014, 08:32 AM
  7. [SOLVED] VBA code to hide/unlide rows based on drop down list
    By evakotsi in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-03-2012, 10:30 PM

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