+ Reply to Thread
Results 1 to 3 of 3

List box - RunTime Error '380':Could not set the list property.invalid property value

  1. #1
    Registered User
    Join Date
    06-08-2010
    Location
    NY, NY
    MS-Off Ver
    Office 2003, Office 2007
    Posts
    18

    List box - RunTime Error '380':Could not set the list property.invalid property value

    Hi all,

    I am working on a spreadsheet with 14 columns. When i search for a value in the first column and try to populate a list box with the matching value and row. I am getting the following error

    Run-Time Error '380': Could not set the list property. invalid property value.

    The code i am using for populating the list box is shown.
    I was able to utilize the code for a 10 column spreadsheet. I updated it for use on the 14 column spreadsheet but i am stuck. The code stops on the line with
    .List(.ListCount - 1, 10) = c.Offset(0, 10).Value.

    Any ideas what i am doing wrong?

    Thank you for all your help





    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by hey1000; 06-24-2010 at 01:58 AM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: List box - RunTime Error '380':Could not set the list property.invalid property v

    Hello hey1000,

    Both the ListBox and CombBox controls have a 10 column limit unless they are bound to a worksheet range. You specify the range in the control's RowSource property. The other problem is the cells must all be contiguous (touching each other). The visible cells of a filter operation are rarely contiguous. There are usually lots of breaks between rows. You have to use 2 loops to get the values of all the cells. The first loop steps through each "Area" or group of contiguous cells. The second loop steps through each of the "Areas".
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    06-08-2010
    Location
    NY, NY
    MS-Off Ver
    Office 2003, Office 2007
    Posts
    18

    Re: List box - RunTime Error '380':Could not set the list property.invalid property v

    Thank you for your quick response.

    Ok so i understand that 10 is the max column limit. And i dont think i can bound the listbox because the listbox gets populated after i sort the rows based on criteria searched for in column a. I dont understand what you are describing using two loops. I am attaching a dummy workbook. The majority of the functions do not work yet. I have taken a working database that i was using with only 9 columns and am trying to redesign it for this project.

    What i am trying to accomplish is have the user search by any of the columns, eventually, i will work on the first column and then worry about the rest. After they search by the first column the row(s) should populate the list box so that the user can select that row and it auto fills the textboxes in the userform allowing for ammendments or deletion.

    I am not sure that will be possible based on what you are telling me. If it is not possible, do you have any ideas on how i can accomplish something like this?

    Thank you again for your quick and informative response.

+ 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