Consulting

Results 1 to 7 of 7

Thread: Solved: UF countif in range

  1. #1
    VBAX Expert
    Joined
    Apr 2007
    Location
    Orlando, FL
    Posts
    751
    Location

    Solved: UF countif in range

    I have a userform that I would like to figure out how to do the following.
    I want to be able to get a count of how many times a value is found in a range and display it in the userform.

    So in the userform I have a lblticket.caption which has a value.
    I want to look at the "Complete" sheet Range(G:G) and return a count and display it in lblUnits.caption

  2. #2
    Pretty impressive post count. Do you code much?

    pseudocode
    for each varcell in Sheets("Complete").usedrange.cells
        if the variable i want to count is there
           count ++
    next
    lblunits.caption = count

  3. #3
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [VBA]lblUnits.caption = Application.Countif(Worksheets("Complete").Columns("G"), "value")[/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

  4. #4
    VBAX Expert
    Joined
    Apr 2007
    Location
    Orlando, FL
    Posts
    751
    Location
    Hey XLD i am getting Run-time error '438'
    Object doesn't support this property or method

    Any ideas why?

  5. #5
    VBAX Expert
    Joined
    Apr 2007
    Location
    Orlando, FL
    Posts
    751
    Location
    Nevermind I had a typo. That Worked XLD

  6. #6
    VBAX Expert
    Joined
    Apr 2007
    Location
    Orlando, FL
    Posts
    751
    Location
    I noticed a problem now with this.
    I am getting a 1 value even when no the value is not located.
    How can I have it show a 0 when not found?

  7. #7
    VBAX Expert
    Joined
    Apr 2007
    Location
    Orlando, FL
    Posts
    751
    Location
    Nevermind I found the problem

Posting Permissions

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