LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 205
Default Listbox and Collections (Again!)

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
-----------------------------------------

End Sub


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Collections of Collections David Morton Excel Programming 6 November 13th 04 01:10 AM
Help with collections ksnapp[_45_] Excel Programming 1 April 7th 04 12:42 AM
Using Collections Kerry[_4_] Excel Programming 1 January 25th 04 04:08 PM
listbox.value not equal to listbox.list(listbox.listindex,0) ARB Excel Programming 0 October 22nd 03 12:46 AM
Comparing Collections Tom Ogilvy Excel Programming 1 September 17th 03 06:15 PM


All times are GMT +1. The time now is 10:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"