Results 1 to 3 of 3

Thread: max number of elements

  1. #1

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,092
    Is there a way to determine the total number of elements in an array?

    Like if I did this:
    Code:
    Dim stuff As Variant
    stuff = Split(Text1.Text,",")
    that turns stuff into an array. Is there a way to return how many elements are in that array??

  2. #2
    Guest
    Use the UBound() function.
    Code:
    MsgBox "There are " & UBound(stuff) & " number of elements in this array"

  3. #3
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    If it's 2-10, though that will return 10.

    Use UBound() - LBound()
    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

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