+ Reply to Thread
Results 1 to 3 of 3

Error 381Could not set the List property. Invalid property array index

  1. #1
    Registered User
    Join Date
    12-02-2011
    Location
    Belgium
    MS-Off Ver
    Excel 2003
    Posts
    8

    Error 381Could not set the List property. Invalid property array index

    Hi there,

    I try to populate my listbox with data from a range

    I have some code like this:

    With Me.ListBox2
    .ColumnCount = 1

    .List = rSubCat2.Value

    End With

    The code to fill the range is this one:
    N = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row
    Set rSubCat2 = Application.Range("A1:A" & N)

    rSubCat2 is a range wich is filled with a filtered range.

    All works well, except when there is no data in the range. Then I get error 381 when de listbox is filled.

    I can't find the solution for what to do when there are no values in the range.

    The relevant code is in module 20 and userform 'ControlPanel3'

    Anybody any ideas?

    Cheers,

    Sonny
    Attached Files Attached Files
    Last edited by desonny; 12-15-2020 at 08:03 PM.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Error 381Could not set the List property. Invalid property array index

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    12-02-2011
    Location
    Belgium
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Error 381Could not set the List property. Invalid property array index

    Thanks alot!

+ 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. VBA Userfrom with 2 listbox Calculating data
    By booney440 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-05-2020, 11:54 AM
  2. [SOLVED] Populating selected range to listbox
    By cupid800429 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-14-2017, 06:22 AM
  3. [SOLVED] UserFrom Checkbox Selection not populating Cells
    By midnightorion in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-10-2015, 11:21 PM
  4. VBA code for a search of data and return result to a listbox on userfrom
    By stevebreslin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-04-2013, 04:14 AM
  5. Help Pre-Populating userfrom into unknown textbox
    By clemsoncooz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-01-2012, 03:34 AM
  6. Error while populating an array from a listbox
    By shivboy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-10-2007, 02:10 AM
  7. Populating a listbox from range xl2003
    By Ramthebuffs in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-03-2005, 10:38 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