Hi guys,
i hope some one can help me. i am really stuck.
I have posted this elsewhere, but as I am struggling to get a working solution, I am also posting here in the hopes of a breakthrough. I will re-link etc. (http://www.excelforum.com/excel-prog...a-listbox.html)
Detail:
i have 12 controls/fields used for capturing data via a UserForm, updating a ListBox that is part of the same UserForm.
However, the problem lies in this: I can only capture 10 columns to the ListBox. I get an error every time the code loops from 10 to the 11th column.
Error: 380: Could not set List property, Invalid Property value.
My code is very simple:
I have attached a sample workbook as well.Private Sub cmdAdd_Click() Dim arrCtrls As Variant Dim i As Long Dim LastRowIndex As Long Dim currentReference As RowReference arrCtrls = Array(TextBox1, TextBox2, TextBox3, TextBox4, TextBox5, TextBox6, TextBox22, TextBox23, TextBox24, TextBox25, TextBox26, TextBox27) With ListBox1 .ColumnCount = UBound(arrCtrls) + 2 .AddItem For i = 0 To UBound(arrCtrls) - 1 .List(.ListCount - 1, i) = arrCtrls(i).Value Next i End With End Sub
Thank you in advance!




Reply With Quote