COUNTIFS


Sub contifs()
Dim i As Integer
For i = 11 To Sheet1.Range("F1048576").End(xlUp).Row
Cells(i, "G") = Application.CountIfs(Sheets("Sheet1").Range("A:A"), Sheets("Sheet1").Range("G9"), Sheets("Sheet1").Range("C:C"), Cells(i, "F"))
Cells(i, "H") = Application.CountIfs(Sheets("Sheet1").Range("B:B"), Sheets("Sheet1").Range("G9"), Sheets("Sheet1").Range("C:C"), Cells(i, "F"))
Next
End Sub

Popular posts from this blog

50 Excel VBA Oral Interview Questions