Here's a way to find the minimum value in a range of cells, after excluding zero
Code:Dim rng as range
Set rng = Range("SomeRangeWhichAlsoHasZeroesInIt")
dbl = Evaluate("MIN(IF(" & rng.Address & "=0,""""," & rng.Address & "))")
Printable View
Here's a way to find the minimum value in a range of cells, after excluding zero
Code:Dim rng as range
Set rng = Range("SomeRangeWhichAlsoHasZeroesInIt")
dbl = Evaluate("MIN(IF(" & rng.Address & "=0,""""," & rng.Address & "))")
It could also be written as
Code:dbl = Evaluate("MIN(IF(" & rng.Address & "<>0," & rng.Address & "))")
Would that not exclude all negative numbers as well as zero?
can you use
<>0