worksheetfunction

N

nyn04

I try to use the following

CountPosS = WorksheetFunction.CountIf(TradesDiff, ">0")

and I get an error messege type mismatch when I run


CountPosS = WorksheetFunction.CountIf(TradesDiff) it works

my TradesDiff is defined
Dim TradesDiff()
m= 17

ReDim TradesDiff(m)

then I run a loop to fill in the values

what do I have to do to be able to use the countif propert
 
D

Don Guillett

try any of these
MsgBox Application.CountIf(Range("f1:f12"), ">0")
MsgBox Application.CountIf(range("tradesdiff"), ">0")
MsgBox Application.CountIf([tradesdiff], ">0")
 
Top