Alumicarus
New Member
- Joined
- Sep 2, 2005
- Messages
- 25
Hi again,
still working on this list box problem.
I have some code that has asked a user a series of questions and populated a two dimensional array. I need my code at some point to automatically call a listbox up to display the contents of the array.
I am able to pass the array from one procedure to another, but i cannot seem to send it to my userform.
In the following example i am using some code i grabbed from a book to populate a similar 2 dim array.
Any ideas?
thanks
Ashley
still working on this list box problem.
I have some code that has asked a user a series of questions and populated a two dimensional array. I need my code at some point to automatically call a listbox up to display the contents of the array.
I am able to pass the array from one procedure to another, but i cannot seem to send it to my userform.
In the following example i am using some code i grabbed from a book to populate a similar 2 dim array.
Code:
' this part is just to Fill the list box variable "DATA"
Dim data(1 To 12, 1 To 2) As Variant
For i = 1 To 12
data(i, 1) = Format(DateSerial(2001, i, 1), "mmmm")
Next i
For i = 1 To 12
data(i, 2) = Day(DateSerial(2001, i + 1, 1) - 1)
Next i
'this will call up txtlistboxarray - but it will be empty
txtListboxarray.Show
'I tried this but it does not work
'txtListboxarray.Show (data)
'just for a sanity check i tried to pass to another procedure "mycall"
'the contents of data were successfully passed
Call mycall(data)
End Sub
'the following is the code from my userform txtlistboxarray
'again this comes up but "data" does not appear to be available to populate
'the listbox
--------------------------------------------------------------------------------
Sub txtListBoxarray_Click(data, mypassedvariable)
txtListboxarray.ColumnCount = 2
txtListboxarray.List = data
End Sub
------------------------------------------------------------------------------
Private Sub UserForm_Click()
End Sub
Any ideas?
thanks
Ashley