Jean-Pierre,
This works for me
With ActiveSheet 'Worksheets("deelnemers")
cohort = Application.CountIf(.Range("D3:D992"), "<" & stap + 5) - _
Application.CountIf(.Range("D3:D992"), "< " & stap)
End With
--
HTH
RP
(remove nothere from the email address if mailing direct)
"Jean-Pierre D via OfficeKB.com" wrote in message
...
Hi Niek,
your suggestion doesn't work....
this is my new function:
cohort = Application.CountIf(Worksheets("deelnemers").Range ("D3:D992"),
"<"&stap&"+5") -
Application.CountIf(Worksheets("deelnemers").Range ("D3:D992")
, "<stap")
I get a "compile error" in your suggestion
I adapted your suggestion to:
cohort = Application.CountIf(Worksheets("deelnemers").Range ("D3:D992"),
"<" &
stap & "+5") -
Application.CountIf(Worksheets("deelnemers").Range ("D3:D992"),
"<" & stap)
This generates no error message but now it seems that it generates the
number
of items in the list that do not meet the criteria instead of those that
do...
with step = 25 i get a respons of 927 while there ar only a few people
between 25-30
any ideas?
I get the message:
Niek Otten wrote:
"<"&stap&"+5"
Hi,
[quoted text clipped - 21 lines]
goes wrong.
any adeas ?
--
Message posted via http://www.officekb.com