J
John
Hi there,
Yes I know the newsgroups are littered with this sort of question, but I
just can't find the answer.
I'm trying to fill the RowSource property with a collection ("List"), that
I've passed to another collection ("colNameForm"). The colNameForm
collection appears to be ok as the "Debug.Print v(0), v(1)" part chucks out
the correct two strings. It's only when I then get to the "Sub
LoadListboxes()" that I get a problem.
I'm getting a "Compile error: Arguement not optional"
Any clues?
Thanks
John
PS I want both parts to be in a 2 column listbox.
-----------------------------------------
'Module level
Dim colNameForm As New Collection
-----------------------------------------
Dim List As New Collection
Dim v As Variant
Dim item As Variant
Set arrFunctionForm = List
Set List = Nothing
For Each item In colNameForm
v = item
Debug.Print v(0), v(1)
Next item
-----------------------------------------
-----------------------------------------
Private Sub LoadListboxes()
Dim Ctrl As MSForms.Control
For Each Ctrl In Me.Controls
Select Case Ctrl.Name
Case "lstListBox1"
Ctrl.Clear
Ctrl.ColumnCount = 2
Ctrl.RowSource = colNameForm
Case "lstListBox2"
Case "lstListBox3"
End Select
Next Ctrl
Yes I know the newsgroups are littered with this sort of question, but I
just can't find the answer.
I'm trying to fill the RowSource property with a collection ("List"), that
I've passed to another collection ("colNameForm"). The colNameForm
collection appears to be ok as the "Debug.Print v(0), v(1)" part chucks out
the correct two strings. It's only when I then get to the "Sub
LoadListboxes()" that I get a problem.
I'm getting a "Compile error: Arguement not optional"
Any clues?
Thanks
John
PS I want both parts to be in a 2 column listbox.
-----------------------------------------
'Module level
Dim colNameForm As New Collection
-----------------------------------------
Dim List As New Collection
Dim v As Variant
Dim item As Variant
Set arrFunctionForm = List
Set List = Nothing
For Each item In colNameForm
v = item
Debug.Print v(0), v(1)
Next item
-----------------------------------------
-----------------------------------------
Private Sub LoadListboxes()
Dim Ctrl As MSForms.Control
For Each Ctrl In Me.Controls
Select Case Ctrl.Name
Case "lstListBox1"
Ctrl.Clear
Ctrl.ColumnCount = 2
Ctrl.RowSource = colNameForm
Case "lstListBox2"
Case "lstListBox3"
End Select
Next Ctrl