View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Bob Kilmer Bob Kilmer is offline
external usenet poster
 
Posts: 280
Default requiring parameters to be of a certain type

In the case of a Sub (which does not itself return a value) the second As
<type is not used and would be a syntax error.

(Subs can modify arguments passed ByRef (the default) and result in a
modified argument value for the caller but they are not allowed to return
values that can be assigned like a function.)

--
Bob Kilmer


"J.E. McGimpsey" wrote in message
...
The first declares the argument (f) data type, the next declares the
data type returned by the Function (default is Variant)

In article ,
"Jamie Martin" wrote:

Awesome. Why do I need to say "As String" twice?

"Bob Kilmer" wrote in message
...
Just declare the argument type in the function declaration.

Function foo(f as String) As String