I have changed this countif formula into a macro: but it is giving me 0 instead of 10 does anyone know why??
Code:
=COUNTIF(KTPT80T!G:G,"Y")
Code:
Sub test()
Dim x As Long
x = Range("G" & Rows.Count).End(xlUp).Row
If x < 100 Then x = 100
Range("Z2") = Application.WorksheetFunction.CountIf(Range("G5:G" & x), "Y")
End Sub