View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Jeff Jeff is offline
external usenet poster
 
Posts: 921
Default Return value for a function.

Hi,

My function returns an integer and I want it to return the double value.


Sub testFunction()
dim x7 as double

x7 = 6543.54384
X3 = MaxValue(55, x7)
'but X3 = 6544 not 6543.54384 like I want

Function MaxValue(a, b)

If a < b Then
MaxValue = b
Else
MaxValue = a
End If

End Function