Results 1 to 12 of 12

Thread: subscript out of range.... what am i doing wrong?

Hybrid View

  1. #1
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: subscript out of range.... what am i doing wrong?

    Please, indent your code ...

    I presume you have populated the array first before you click Display. I'm not sure what your Index variable is for but you could just use UBound instead.

    VB Code:
    1. Private Sub CmdDisplay_Click()
    2. Dim i As Long
    3.     lstNumbers.Clear
    4.     For i = 0 To UBound(Numbers)
    5.         lstNumbers.AddItem Numbers(i)
    6.     Next i
    7. End Sub

  2. #2

    Thread Starter
    Addicted Member oldmcgroin's Avatar
    Join Date
    Jul 2005
    Location
    Manchester, UK
    Posts
    182

    Re: subscript out of range.... what am i doing wrong?

    Please, indent your code ...
    lol sorry, will do.

    i have populated the array. i tried your code and it stops the erro messagwe although all the numbers in the display are now zero...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width