Hi, I cant figure out the syntax for CountIf, Im trying to add the following variables to countif, but I keep getting errors.
Thanks, much appreciated.
Thanks, much appreciated.
Code:
Sub ValleysDips()
Dim ValuesRange As Range
Dim ValuesRange As String
Dim ResultCell As Range
Dim CriteriaValue As String
Set ValuesRange = Range("A1:A10")
Set ResultCell = Range("C3")
CriteriaValue = "A1"
Range(ResultCell) = Application.WorksheetFunction.CountIf(Range(ValuesRange), "<" & Range(ResultCell))
End Sub