Results 1 to 3 of 3

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

Threaded View

hey1000 List box - RunTime Error... 06-23-2010, 11:41 PM
Leith Ross Re: List box - RunTime Error... 06-24-2010, 01:17 AM
hey1000 Re: List box - RunTime Error... 06-24-2010, 01:57 AM
  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





    
    Sub Findall2()
    
        Dim STRFIND As String    'what to find
        Dim rFilter As Range     'range to search
        Set rFilter = Sheet2.Range("a3", Range("n65536").End(xlUp))
        Set rng = Sheet2.Range("a2", Range("a65536").End(xlUp))
        STRFIND = Me.TextBoxArrest.Value
        With Sheet2
            If Not .AutoFilterMode Then .Range("A3").AutoFilter
            rFilter.AutoFilter Field:=1, Criteria1:=STRFIND
            Set rng = rng.Cells.SpecialCells(xlCellTypeVisible)
            Me.ListBox1.Clear
            For Each c In rng
                With Me.ListBox1
                    .AddItem c.Value
                    .List(.ListCount - 1, 1) = c.Offset(0, 1).Value
                    .List(.ListCount - 1, 2) = c.Offset(0, 2).Value
                    .List(.ListCount - 1, 3) = c.Offset(0, 3).Value
                    .List(.ListCount - 1, 4) = c.Offset(0, 4).Value
                    .List(.ListCount - 1, 5) = c.Offset(0, 5).Value
                    .List(.ListCount - 1, 6) = c.Offset(0, 6).Value
                    .List(.ListCount - 1, 7) = c.Offset(0, 7).Value
                    .List(.ListCount - 1, 8) = c.Offset(0, 8).Value
                    .List(.ListCount - 1, 9) = c.Offset(0, 9).Value
                    .List(.ListCount - 1, 10) = c.Offset(0, 10).Value
                    .List(.ListCount - 1, 11) = c.Offset(0, 11).Value
                    .List(.ListCount - 1, 12) = c.Offset(0, 12).Value
                    .List(.ListCount - 1, 13) = c.Offset(0, 13).Value
                End With
            Next c
        End With
    End Sub
    Attached Files Attached Files
    Last edited by hey1000; 06-24-2010 at 01:58 AM.

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