Error setting List Property of Userform Listbox With VBA

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
4,629
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I have a dynamic range of cells in a worksheet that I have given the name "nrngUXDump". This named range of cells is to form the contents of a listbox (".lbx_collections") on my userform "IFM_Title"
This is the code I am using. It is giving me an error - "Could not set the List property. Invalid property array idex" - with the line in red.

Rich (BB code):
 ...      
       With IFM_Title
            .tbx_titlecnt.Value = WorksheetFunction.CountIf(ws_dump.Columns(1), txt_model)
            .tbx_checkedcnt.Value = WorksheetFunction.CountIf(ws_dump.Columns("W"), "YES")
            .tbx_collectedcnt.Value = WorksheetFunction.CountIf(ws_dump.Columns("V"), "OK")
            With .lbx_collections
                .columnCount = 4 'collected, title, primary, model checked
                .ColumnWidths = "15,96,42,15"
                .List = "nrngUXDump"
            End With
        End With
 ...

nrngUXDump refers to a range of U2:X14 in worksheet ws_dump. I assessed the names in the current workbook and it is there amd I believe appears to have all the data.
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Thanks Dave. I really don't know what that means to be able to fix it though. I did try removing the quotes having resulted in the same error. Perhaps use the rowsource property?
 
Upvote 0
Either that or use Application.Range("nrngUXDump").Value
 
Upvote 0
Solution
Thank you Rory for sharing the solution.
 
Upvote 0

Forum statistics

Threads
1,225,122
Messages
6,182,975
Members
453,142
Latest member
Konstako

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top