I am loading a listbox ("Listbox1") by name in the main body of code. I want to be able to do it in a subprogram, and I cannot seem to get it to work.
Sample code--
'Load Listbox
For iRow = 2 To iListLength + 1
Listbox1.AddItem (Sheets("Sheet1").Range(CallRange).Value)
Next iRow
iListLength is the number of items in the listbox
The listbox items themselves are on a worksheet (Sheet1, CallRange)
How might this code be modified so it can be called as a subprogram? I'd need to pass the name of the listbox as a parameter, plus (of course) sheet and range names.
Thank you,
pmanney@oriuscorp.com
Sample code--
'Load Listbox
For iRow = 2 To iListLength + 1
Listbox1.AddItem (Sheets("Sheet1").Range(CallRange).Value)
Next iRow
iListLength is the number of items in the listbox
The listbox items themselves are on a worksheet (Sheet1, CallRange)
How might this code be modified so it can be called as a subprogram? I'd need to pass the name of the listbox as a parameter, plus (of course) sheet and range names.
Thank you,
pmanney@oriuscorp.com