Reed Turgeon
Reed Turgeon

Reputation: 281

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!!

Upvotes: 1

Views: 737

Answers (1)

Harun24hr
Harun24hr

Reputation: 36840

What about this simple code---

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

Upvotes: 1

Related Questions