+ Reply to Thread
Results 1 to 11 of 11

Hiding Named Range based on validation selection on another WS

  1. #1
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    405

    Question Hiding Named Range based on validation selection on another WS

    Hi there,

    I've got a worksheet ("Main") that has a validation box that the user selects an option from (Range: H12:J13). the possible options are Red Red,Blue Blue, Colour Group, Rough Rough, Smooth Smooth, Texture Group.
    on sheets(1) i have a list of named ranges. they are: RedRed, BlueBlue, ColourGroup, RoughRough, SmoothSmooth, TextureGroup.

    The named ranges (eg RedRed) names are derived from the cell value of the first Row in column A of that bordered range. (note that the namedrange.name has no space whereas the validation selection does)

    When the user selects an option (say RedRed) from sheet ' main' then all the named ranges except for RedRed should be hidden. Similarly for (BlueBlue, RoughRough, SmoothSmooth)

    ColourGroup and TextureGroup on the other hand do not relate to a named range. They are values that are found in 2nd row below named ranges - common to more than one named range (in Col A row 2 of RedRed cell.value = ColourGroup & in Col A row 2 of BlueBlue cell.value = ColourGroup). When the user selects this option (Eg ColourGroup) then the RoughRough & SmoothSmooth named ranges should be hidden - whereas all the 'colours' are visible on sheets(1)

    I've attached a sample WB
    Attached Files Attached Files

  2. #2
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Hiding Named Range based on validation selection on another WS

    Try it. I was a little changed the existing codes.
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    405

    Re: Hiding Named Range based on validation selection on another WS

    thank you nilem, I should be able to modify this to suit my file!

    Is there any way we can have the validation selections so that they have a space between the names like in my attached workbook?

    regards

  4. #4
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Hiding Named Range based on validation selection on another WS

    I do not understand. Are there no spaces in the validation list in my file?

  5. #5
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    405

    Question Re: Hiding Named Range based on validation selection on another WS

    Nilem, Thank you for your help

    I got this working (Partly)

    there are a couple things that I need some more help with

    * From the validation box *
    1. Do not show any numbers as a selection
    2. When the user selects the 'Group Options' then the WS Crashes

    I've attached A sample WB which contains the code you posted above with the data from my problem
    Regards
    Attached Files Attached Files

  6. #6
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Hiding Named Range based on validation selection on another WS

    Hi
    Open your file "example8", press Ctrl+F3 and see a list of names. I added a button "Clear Names" to get rid of unnecessary names. This will avoid errors.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    405

    Re: Hiding Named Range based on validation selection on another WS

    Excellent Nilem! Thank You for your help with this!!

  8. #8
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    405

    Re: Hiding Named Range based on validation selection on another WS

    Also how could i get this to unhide named ranges over multiple worksheets?

    The name format of the worksheets i want this to run on are always of ##-##-#### date format

    The issue is that the named ranges would be the same over each WS.

    i.e. I would receieve an error as we cannot have more than 1 named range with the identical name i.e. on sheet(1) nm = John_Smith and on sheet(2) nm = John_Smith also.

    The code i have been using to automatically name the ranges is
    Please Login or Register  to view this content.

  9. #9
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Hiding Named Range based on validation selection on another WS

    Jordan, why do you need named ranges? It may be better just to find and hide required rows on the sheets according to type of the selected item in the list?

  10. #10
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    405

    Re: Hiding Named Range based on validation selection on another WS

    The number of rows in the worksheets changes from week to week. Including the number of rows within each of the named ranges.
    This is why i am using named ranges

    regards

  11. #11
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Hiding Named Range based on validation selection on another WS

    Here's a version without the named ranges (I was a little cut your file).

    Edited
    Oops. Found a bug. Attached another file.
    Attached Files Attached Files
    Last edited by nilem; 06-05-2012 at 05:20 AM.

  12. #12
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    405

    Re: Hiding Named Range based on validation selection on another WS

    Thanks yet again Nilem - Interesting to see you different approach of doing this!

    I've attached another WB - I have been trying to use your code to create another validation box for the user to further narrow what is displayed on the ##-##-#### worksheets

    This new validation should allow the user to select which individual person or Crew to display on the worksheets.

    If in the 'Group' validation is 'Show All' then the possible selections should display every Individual and Crew as a possible selection.
    If in the 'Group' validation is 'Dave W' then All then 'Dave W' Rows should be unhidden on all the sheets in ##-##-#### name format. and in the User Validation only the visible cell values should be a possible selection for the user. There should also be a 'Show all' selection in this validation as what i've done with the 'Group' validation case.
    Attached Files Attached Files
    Last edited by jordan2322; 06-05-2012 at 10:50 PM.

+ 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