Hi,
I have the following formula on a cell and it gives me number 78.
=COUNTIF(Y2:Y505,"<"&TIME(0,2,0))
However, when I tried to code that formula using VBA it returned a different number instead. Wonder if someone could point out what I did wrong.
I'm trying to count the number of rows that have time less than 2 mins.
Thank you!
I have the following formula on a cell and it gives me number 78.
=COUNTIF(Y2:Y505,"<"&TIME(0,2,0))
However, when I tried to code that formula using VBA it returned a different number instead. Wonder if someone could point out what I did wrong.
Code:
finalRow = ThisWorkbook.Worksheets("Paste").Cells(Sheets("Paste").Rows.Count, "A").End(xlUp).Row
ThisWorkbook.Worksheets("Summary").Range("B7").Formula = WorksheetFunction.CountIf(ThisWorkbook.Worksheets("Paste").Range("Y2:Y" & finalRow), "<" & Time(0, 2, 0))
I'm trying to count the number of rows that have time less than 2 mins.
Thank you!