vbaexcelexcel-formulacountif

VBA CountIf() loop / Countifs() loop


I am new to VBA and have had some success reverse engineering VBA using the VBA Recorder. However I am having a problem creating a CountIfs() loop for all cells containing the value "TT" in EITHER an entire column OR a dynamic range of a single column (using .end(xldown) / .end(xlup))

I would post my code but honestly, I have found so many different 'answers' to this question that I have not been able to mold to my use case yet and I do not think I am very close with any individual methodology. (ultimately I need to expand this to be a CountIfS() based on other column values but one step at a time)...

THANKS!!


Solution

  • What about this simple code---

    Sub vbaCountIF()
        Dim Rslt
        Rslt = WorksheetFunction.CountIfs(Range("A:A"), "TT")
        MsgBox Rslt
    End Sub