Consulting

Results 1 to 3 of 3

Thread: Solved: length of array

  1. #1
    VBAX Tutor
    Joined
    Oct 2007
    Posts
    210
    Location

    Solved: length of array

    I have defined an unspecified array

    [VBA]dim MyArray() as variant[/VBA]

    is there a keyword or function that can tell me how many items are in the array?
    "The amount of stupid people in the world is God's way of punishing the smart people" - protean_being

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    UBound(MyArray) - LBound(MyArray) + 1
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Tutor
    Joined
    Oct 2007
    Posts
    210
    Location
    Thanks.
    "The amount of stupid people in the world is God's way of punishing the smart people" - protean_being

Posting Permissions

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