View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default passing reference arguments to VBA function

Excel takes care of resolving arguments in the command line. You just
process the results.

For dynamic arguments, one usually uses the parmarray. You then loop
through the array and check the type of each argument and process
accordingly.

As an example with the UDF

Public Function InterpretResults(varr)
msg = TypeName(varr)
If msg = "Range" Then
msg = msg & varr.Address
End If
InterpretResults = msg

End Function

then in the worksheet I have the formula

=InterpretResults(B5:G5 C2:C8)

and the cell displays

Range$C$5

--
Regards,
Tom Ogilvy

"Mezon" wrote in message
...
Hi,
Does anyone know how to pass/program the use of the :,
the (space), and the , (comma) reference designation
syntax conventions available to intrinsic Excel funtions
to a single VBA function?
Thanks