View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Jeff Jeff is offline
external usenet poster
 
Posts: 921
Default Function and Sub

Hi,

I have a function that returns a value. I just set the value = to the name
of the function. Is there a way to do this with a "Sub" procedure - I mean
return a value without creating a global variable. I wanted to use a Sub in
the future because you can do more manipulation.

Function MaxValue(a, b)

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

End Function