Consulting

Results 1 to 4 of 4

Thread: arrays

  1. #1

    arrays

    Hi, Im using a array in Excel VBA, i got a method which looks at a element no of the array as as a return for that array, i have got it to sort the array, i just need some help to find the middle number (median) of the array.

    thanks

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

    myMid = (UBOUND(myArray) - LBound(myArray) + 1) \ 2
    [/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
    Quote Originally Posted by xld
    [vba]

    myMid = (UBOUND(myArray) - LBound(myArray) + 1) \ 2
    [/vba]
    Hi Thanks for the reply, the problem is my array is returning a element no in the array, so when i just called myarray in the median code, it returns a error

    Public Property Get GetEndAct(ElementNo As Integer) As Integer
        ' SORT ARRAY IN ACSCENDING ORDER
        SortArray NodeEndActs
        GetEndAct = NodeEndActs(ElementNo)
    End Property
    this is how it looks

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    I have absolutely no idea what all that means.
    ____________________________________________
    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

Posting Permissions

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