+ Reply to Thread
Results 1 to 4 of 4

Listboxes and dynamic/spilled arrays

  1. #1
    Registered User
    Join Date
    02-19-2021
    Location
    London, England
    MS-Off Ver
    Office 365 with Excel (Beta)
    Posts
    4

    Listboxes and dynamic/spilled arrays

    I am populating two listboxes with data from a spreadsheet where the data is in a spilled/dynamic array
    Both ranges are on the same worksheet and accessed in the same subroutine in the same module.
    Each range is a single column of data.
    Both formulae are of the form =SORT(...) and both work in the worksheet; neither contains errors
    Both spilled ranges are between 2 and 20 items in length.
    Both listboxes are on the same form.

    Please Login or Register  to view this content.
    The first of those works and populates the first list box. The second fails with a "Run-time error '381': Could not set the List property. Invalid property index".

    Why should the first be valid and the second not?
    Have I got the code wrong (I couldn't find any examples on the web) ?

    Really puzzled

    M

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Listboxes and dynamic/spilled arrays

    Welcome to the forum!

    Named ranges would only need the sheet codename prefix if locally named.

    On the codesheet shtRespondentList, in the dropdown list of named ranges towards top left, select DateofRespondentEntriesTemp2#. If it is a dynamically named range, you likely do not have any items in the array.

    We would need to see the formula for the dynamic named range with some sample data to test. Using =Sort(), I suspect that your dynamic named array would use an OffSet() to get the sorted range extents. If the dynamic array by formula is done, you may need an Offset() to get the sorted data range for List.

    You can attach a short simple XLSM by clicking Go Advanced button in lower right of a reply. Click the paperclip on the reply toolbar or Manage Attachments hyperlink below the reply box to upload/attach a file.

  3. #3
    Registered User
    Join Date
    02-19-2021
    Location
    London, England
    MS-Off Ver
    Office 365 with Excel (Beta)
    Posts
    4

    Re: Listboxes and dynamic/spilled arrays

    I always use full name, it's just a habit to make things easier for me.
    There are items in both list - as I said both spilled ranges contain between 2 and 20 items in use. Even if the second one fails to find any items it defaults to providing a single item.

    The formula which delivers the first spilled range "Unique_Respondents#" is:
    =CHOOSE(RespondentNameSortBy, UNIQUE(SORT(Form_revised[Full Name],1)),UNIQUE(SORTBY(Form_revised[Full Name],Form_revised[SortedName],1)))

    The formila which delivers the second spilled range "DateofRespondentEntriesTemp2#" and fails is, in fact, the simpler:
    =SORT(FILTER(Form_revised[Timestamp],Form_revised[Full Name]=$N$1,"No results"),,-1)

  4. #4
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Listboxes and dynamic/spilled arrays

    I have no way to test that without the actual data.

    You can find the named range's address by using this sort of routine.
    Please Login or Register  to view this content.
    My guess is that some cell in your 2nd named range caused an error.
    You can test using this method:
    Please Login or Register  to view this content.

+ 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. Formula - Sum and multiplying - Dynamic array spilled behavior
    By ttch in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-30-2020, 02:54 PM
  2. Dynamic Arrays, Dynamic Drop down list, Filters and multiple rows
    By Big_Kev007 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-09-2020, 06:35 AM
  3. Countifs / Sumifs with dynamic arrays (spilled ranges)
    By esbencito in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 03-08-2020, 02:43 PM
  4. Dynamic, Spilled, Named Ranges - how to override SPILL
    By TimB in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-24-2020, 01:53 PM
  5. [SOLVED] YTD with dynamic spilled array
    By MatthewHart74 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 12-14-2019, 07:49 AM
  6. YTD with spilled dynamic array
    By MatthewHart74 in forum Office 365
    Replies: 0
    Last Post: 12-12-2019, 12:05 PM
  7. User Defined Dynamic Cascading Listboxes
    By rabbit_post in forum Excel General
    Replies: 5
    Last Post: 03-27-2018, 08:04 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