nitzbar
08-08-2008, 01:51 PM
Hi.... I need to find the minimum of 2 nos, weeding out zeros and negative numbers.... i tried this.. but it didn't work...
FUNCTION CALCULATING MIN OF 2 NUMBERS
Public Function minx(num1 As Double, num2 As Double) As Double
tmp1 = num1: temp2 = num2
If tmp1 > num2 Then tmp1 = num2: tmp2 = num1
If tmp1 >= 0 Then
k = tmp2
Else
k = tmp1
End If
minx = k
End Function
FUNCTION CALCULATING MIN OF 2 NUMBERS
Public Function minx(num1 As Double, num2 As Double) As Double
tmp1 = num1: temp2 = num2
If tmp1 > num2 Then tmp1 = num2: tmp2 = num1
If tmp1 >= 0 Then
k = tmp2
Else
k = tmp1
End If
minx = k
End Function