Consulting

Results 1 to 5 of 5

Thread: Count item in array

  1. #1
    VBAX Regular
    Joined
    Aug 2005
    Posts
    77
    Location

    Count item in array

    How to count items in array
    Arr1= array("aa", "bb", "cc")
    Reason why i need this is using many For .... next methods.
    example: For i=0 to X 'x is number how many items is in array

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by Cass
    How to count items in array
    Arr1= array("aa", "bb", "cc")
    Reason why i need this is using many For .... next methods.
    example: For i=0 to X 'x is number how many items is in array
    For i = Lbound(Arr1) To UBound(Arr1)
    ____________________________________________
    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 Regular
    Joined
    Aug 2005
    Posts
    77
    Location
    ouh so easy

    thanks

  4. #4
    VBAX Expert
    Joined
    Feb 2005
    Posts
    929
    Location
    Quote Originally Posted by Cass
    How to count items in array
    Arr1= array("aa", "bb", "cc")
    Reason why i need this is using many For .... next methods.
    example: For i=0 to X 'x is number how many items is in array
    Assuming you want to count the # of times any element occurs in the array, you might also see this KB It will probably do what you want and has pretty broad utility
    "It's not just the due date that's important, it's also the do date" [MWE]

    When your problem has been resolved, mark the thread SOLVED by clicking on the Thread Tools dropdown menu at the top of the thread.

  5. #5
    VBAX Regular
    Joined
    Aug 2005
    Posts
    77
    Location
    yes i mean count arry items but UBound do what I mean the code to do

Posting Permissions

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