Moderator: 2020vision
by alrodopial » Thu Mar 25, 2010 10:05 am
by osknows » Thu Mar 25, 2010 12:00 pm
Function MinExZero1(ByVal rng As Range) As Double
Dim objFunc As WorksheetFunction
Set objFunc = Application.WorksheetFunction
With objFunc
MinExZero1 = .Min(rng)
If MinExZero1 = 0 Then
MinExZero1 = .Small(rng, .CountIf(rng, "=0") + 1)
End If
End With
End Function
Sub test()
a = MinExZero1(Range("a1:a4"))
End Sub
by Ian » Thu Mar 25, 2010 12:19 pm
by osknows » Thu Mar 25, 2010 12:27 pm
Ian wrote:Don't you just need to use Application.WorksheetFunction.Min on its own ? If it returns zero then all the values in the range weren't > 0.
by Ian » Thu Mar 25, 2010 12:29 pm
alrodopial wrote:Hi,
I want to find the minimum of a range with criteria using only VBA.
So the min of A1:A100 if all prices at this range are above 0 (>0 the criteria) with VBA
If it was a formula:
MIN(IF(A1:A100>0),A1:A100)) array formula
Any ideas?
I can loop through each cell in the range but it's a slow VBA this way
by osknows » Thu Mar 25, 2010 12:32 pm
alrodopial wrote:Hi,
I want to find the minimum of a range with criteria
by Ian » Thu Mar 25, 2010 12:47 pm
by osknows » Thu Mar 25, 2010 1:32 pm
by alrodopial » Thu Mar 25, 2010 1:59 pm
The strength of Gruss Software is that it’s been designed by one of you, a frustrated sports punter, and then developed by listening to dozens of like-minded enthusiasts.
Gruss is owned and run by brothers Gary and Mark Russell. Gary discovered Betfair in 2004 and soon realised that using bespoke software to place bets was much more efficient than merely placing them through the website.
Gary built his own software and then enhanced its features after trialling it through other Betfair users and reacting to their improvement ideas, something that still happens today.
He started making a small monthly charge so he could work on it full-time and then recruited Mark to help develop the products and Gruss Software was born.
We think it’s the best of its kind and so do a lot of our customers. But you can never stand still in this game and we’ll continue to improve the software if any more great ideas emerge.