M
Mike Fogleman
Can you see what I am doing wrong here.
Sub CntIf()
Dim myrng As Range
Sheets("Node Data").Activate
Cells(1, counter + 2).Value = "Total Leaks per " & Ldb
Set myrng = Sheets(Ldb).Range("B2:B" & rwct)
Range(Cells(2, counter + 2), Cells(85, counter + 2)) =
Application.WorksheetFunction.CountIf(myrng, "$A$2:$A$85")
End Sub
This does put values in the range (Cells(2, counter + 2), Cells(85, counter
+ 2)) , but they are all 0's, not the correct count.
TIA
Mike F
Sub CntIf()
Dim myrng As Range
Sheets("Node Data").Activate
Cells(1, counter + 2).Value = "Total Leaks per " & Ldb
Set myrng = Sheets(Ldb).Range("B2:B" & rwct)
Range(Cells(2, counter + 2), Cells(85, counter + 2)) =
Application.WorksheetFunction.CountIf(myrng, "$A$2:$A$85")
End Sub
This does put values in the range (Cells(2, counter + 2), Cells(85, counter
+ 2)) , but they are all 0's, not the correct count.
TIA
Mike F