Results 1 to 2 of 2

Thread: counting values

  1. #1

    Thread Starter
    Hyperactive Member Bearnerd's Avatar
    Join Date
    Apr 2006
    Location
    Malaysia
    Posts
    290

    Exclamation counting values

    I try to count how many values of 1,2,3... ,40 in the compHAID (compartment-hectares and IDs) array. But I still cannot do it. Please help..


    VB Code:
    1. Dim icount(1 To 40) As integer 'compartment labelled 1-40
    2. Dim N As Long
    3.  
    4. For N = 0 To TotalComp-1 'Total compartments about 448
    5.  
    6. icount(compHAID(N, 3)) = icount(compHAID(N, 3)) + 1
    7.    
    8. Next N
    9.  
    10. MsgBox "Total label no 4 = " & icount(4)

  2. #2
    eltiT resU motsuC Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: counting values

    you need an IF statement

    IF compHAID(N,3) = 4 then
    icount = icount + 1

    something like that..
    you arent comparing anything
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

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