View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Frederik[_3_] Frederik[_3_] is offline
external usenet poster
 
Posts: 63
Default CountIf cell value greater than 14

Since CountIf is a worksheet function, you have to preceed it with

Application.Worksheetfunction.CountIf(etcetera


greetings

"Les" schreef in bericht
...
Hello all,

I have the code below and it is not working ?

I get a compile error: Sub or function not defined and COUNTIF is
highlited ?

Any help woud be appreciated

Sub testToC()
'
Dim poDelay As Variant, lstCell As Long

lstCell = Cells(Rows.Count, "A").End(xlUp).Row
poDelay = CountIf("Q3:Q" & lstCell, "14")

End Sub

--
Les