View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default User defined function

Yugi Gokavarapu formulated on Monday :
On Jan 16, 3:34*pm, GS wrote:
Try:
* Function test(num) As String

* * Select Case num
* * * * *Case Is 0
* * * * * * * *test = "Positive"
* * * * Case Is = 0
* * * * * * * *test = "Zero"
* * * * Case Is < 0
* * * * * * * *test = "Negative"
* * End Select
End Function


You must declare the 'data type' to be returned as shown.

--
Garry

Free usenet access athttp://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


Sorry, I do not see any better


Sorry!!!
I forgot to include that you must declare your function with 'public'
scope...

Public Function test(num) As String
'...code
End Function

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc