Excel 2003 - VBA - Listbox on userform

C

C Brandt

I have a userform with several testboxes, labels and a Listbox

I use the following routine to load the userform and when it trys to load
the listbox excel crashes with the message to send data to microsoft.
The "for" loop is variable up to about 800 entries. Each entry is less then
86 characters long, averaging around 60 characters.
Public Sub FormsWindow()
Load UserForm1
UserForm1.snamInput.Text = Sheets("Calc").Cells(1, 3)
UserForm1.AcctNum.Caption = Sheets("Calc").Cells(1, 14)
UserForm1.AcctName.Caption = Sheets("Calc").Cells(2, 14)
UserForm1.StartDate.Text = Sheets("Calc").Cells(1, 9)
UserForm1.EndDate.Text = Sheets("Calc").Cells(1, 12)
For counter = 1 To MAXList
UserForm1.ListBox1.AddItem Sheets("Param").Cells(counter + 1, 26)
Next counter
UserForm1.Show
End Sub 'FormsWindow


Is this problem common? Am I using the appropriate procedure?

Thanks,
Craig
 
C

C Brandt

The data is string located in a column on worksheet Param.
This is an example of what the data looks like: ABC123 456-7890 Mr
Magoos ROTH IRA
MAXList is a result of a "for" loop that counts the number of entries in the
column.
I have since used this same procedure and ran it as a standalone form with
no difficulty.
Most puzzling.

Craig
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top