How do I fix this so I don't get an "Error 2015"

2

2D Rick

Dim x
x = Application.CountIf("E5,E6000", "T13065")

How do I fix this so I don't get an "Error 2015"

Thanks, Rick
 
N

Nick Hodge

Not tried it but I would think

x=Application.Countif(Range("E5:E6000"),"T13065")

Providing T13065 is a string you are counting. If it's a range reference

x=Application.Countif(Range("E5:E6000"),Range("T13065"))

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
[email protected]
www.nickhodge.co.uk
 
2

2D Rick

Thanks Nick, it works
Rick


Nick said:
Not tried it but I would think

x=Application.Countif(Range("E5:E6000"),"T13065")

Providing T13065 is a string you are counting. If it's a range reference

x=Application.Countif(Range("E5:E6000"),Range("T13065"))

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
[email protected]
www.nickhodge.co.uk
 
Top