View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default Countif Function

You have an issue with " & Minv & "

Try this...
MsgBox Application.CountIf(Selection, " " & Minv )

--
HTH...

Jim Thomlinson


"Bill" wrote:


Hello,
I am missing something simple here I think. I have some data in column
A. I would like to count the data based on criteria; either above some
value, below some value or between two values. I started with the
simple above some value and used the following code:

Sub test()
Dim Minv, Maxv
Application.Goto reference:="aaa"
Minv = 0
MsgBox Application.CountIf(Selection, " & Minv & ")
End Sub

aaa is the named reference containing the data and is OK. All but one
entry is above 0, but the above codes give him 0 for the countif.

What am I doing wrong? Thanks

Bill


*** Sent via Developersdex http://www.developersdex.com ***