Hi,
I have a userform and on this userform i have a listbox. When i try to put ~ 34000 items into a list box is gives me a run time error or "overflow". So i am wondering is there a limit to the number of items one can put into a list box?
Hi,
I have a userform and on this userform i have a listbox. When i try to put ~ 34000 items into a list box is gives me a run time error or "overflow". So i am wondering is there a limit to the number of items one can put into a list box?
Why on earth would you want to have 34,000 items in a list box. It kind of ruins the whole point IMO. I ran this code and i populated 100,000 just fine. The overflow is probably being cause by the declaration of your variable
Private Sub UserForm_Initialize() Dim count As Long On Error GoTo End1 count = 0 Do count = count + 1 ListBox1.AddItem count Loop While count < 100000 Debug.Print count Exit Sub End1: Debug.Print count End Sub
then i guess there was something else that was causing the issue...........if i run into it again i will post for now seems to be running fine.
If the size of the range is less than 32,767, it can not be a variable declaration (If you declare it as Integer). It might be that you are either dividing a number by zero or sometimes if you have a long date, you get an overflow error.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks