View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Rick Rothstein \(MVP - VB\)[_596_] Rick Rothstein \(MVP - VB\)[_596_] is offline
external usenet poster
 
Posts: 1
Default Function and Sub

You can do the exact same manipulation in a Function that you can do in a
Sub. What is it you want to do that you think you need a Sub for?

Rick


"Jeff" wrote in message
...
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