My rng1 only contains non-empty cells to the last cell in column A. I want to count cells greater than the value in B1 in rng1. However, this formula didn't work and showed error was due to empty cells.
Sub CountRng1()
Dim rng1 As Range
Set rng1 = Range(Range("A2"), Range("A2").End(xlDown))
Range("C1").formula="=countif(rng1,"">""&B1)"
End Sub