Count multiple numbers in the same column

  • Hi, can the below code be modified to change "UW" to count (not sum) how many times 0, 1, 2, 3 appear in the same column. I think KjBox originally gave me the code, cheers.

  • Is the intent to find out if x(i, 5) = the number of numeric in the chosen column?

    It is easy enough, but difficult from you question to ensure that is what you are after.


    if so you would do something like replace:

    Code
    1. Const Status As String = "UW"

    with

    Code
    1. dim UW as long
    2. UW = Application.WorksheetFunction.Count(Sheet1.Range("B1:B10"))