+ Reply to Thread
Results 1 to 4 of 4

Dynamic Arrays, Dynamic Drop down list, Filters and multiple rows

  1. #1
    Registered User
    Join Date
    01-23-2020
    Location
    Scotland
    MS-Off Ver
    0365
    Posts
    18

    Dynamic Arrays, Dynamic Drop down list, Filters and multiple rows

    I am trying to create a filtered drop down list dependent upon the answer in a previous drop down list.

    I have all this working but as I have a specific reference to the previous cell in each part of the formula this does not extend to the "next" row.

    How can I make this work for each new row.

    This is the output created within the array is in Admin sheet

    Please Login or Register  to view this content.
    The code for each of the 4 columns is

    DA_Region: =UNIQUE(H2:H97)
    DA_Country: =UNIQUE(FILTER(Table11[Country],Table11[Security Region]='Non-Conformities'!A2))
    DA_City: =UNIQUE(FILTER(Table11[City],Table11[Country]='Non-Conformities'!B2))
    DA_Site: =UNIQUE(FILTER(Table11[Address],Table11[City]='Non-Conformities'!C2))

    This all works for 1 row but I cannot make it work for the next row as the cell reference would then become A3

    Sorry if this is all garbled I know what I want just not the best at describing it.
    Attached Files Attached Files
    Last edited by JBeaucaire; 03-08-2020 at 02:50 PM.

  2. #2
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Dynamic Arrays, Dynamic Drop down list, Filters and multiple rows

    You want data validation lists to be based on entries in the current row in the Non-Conformities worksheet. You need a mechanism to pull in the current row number.

    One way.

    Admin!A1: =IF(COUNT(SEARCH("Non-Conformities",CELL("Address"),NOW()^0)),CELL("row"),#N/A)
    Admin!B1: =INDEX('Non-Conformities'!A:A,$A1)

    Fill Admin!B1 right as far as needed.

    Admin!B3: =UNIQUE(FILTER(Table11[Country],Table11[Security Region]=B$1))
    Admin!C3: =UNIQUE(FILTER(Table11[City],Table11[Country]=C$1))
    Admin!D3: =UNIQUE(FILTER(Table11[Address],Table11[City]=D$1))

    As you make entries in the Non-Conformities worksheet, that will trigger updating the formula in Admin!A1, which will update the values in Admin!B1:D1, which will update the spilled formulas in B3#, C3# and D3#.

    However, this isn't robust. Make an entry in, say, 'Non-Conformities'!A5, then decide you need to correct 'Non-Conformities'!E3, move to that latter cell, but the formulas in Admin!A1:D1 will still refer to row 5.

    The only way to fix this/make this robust is with VBA, specifically, a Worksheet_SelectionChange macro for the Non-Conformities worksheet.

    Please Login or Register  to view this content.

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Dynamic Arrays, Dynamic Drop down list, Filters and multiple rows

    Hi BigKev and welcome to the forum,

    The answer to your problem is to use Dynamic Named Ranges. They will grow or contract based on the number of rows you have in your dropdown list. See:

    https://www.ozgrid.com/Excel/DynamicRanges.htm
    or
    https://helpdeskgeek.com/office-tips...ble-dropdowns/
    for a more specific example.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Registered User
    Join Date
    01-23-2020
    Location
    Scotland
    MS-Off Ver
    0365
    Posts
    18

    Thumbs up Re: Dynamic Arrays, Dynamic Drop down list, Filters and multiple rows

    Great answer, thank you. This has been a great experience and I hope the forum the all the best

    Not sure how to close thread

+ 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. Replies: 8
    Last Post: 11-05-2019, 06:58 AM
  2. [SOLVED] Dynamic drop down in Userform From Dynamic list
    By juriemagic in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-31-2019, 02:30 AM
  3. Replies: 4
    Last Post: 01-15-2019, 08:10 PM
  4. Create dynamic drop down list from dynamic data source
    By rz6657 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-18-2016, 05:22 PM
  5. [SOLVED] Help with Dynamic Validation Lists / Drop Downs / dynamic filters
    By rjnc in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-22-2016, 08:10 PM
  6. dynamic data macro (using arrays, loops, filters)
    By Matheo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-23-2014, 04:49 AM

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