Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default passing reference arguments to VBA function

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default passing reference arguments to VBA function

Thanks Tom, I'll give it a try. John

"Tom Ogilvy" wrote:

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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing Arguments in Excell UB Excel Worksheet Functions 3 February 13th 07 04:08 PM
Passing Arguments in Excell function UB Excel Discussion (Misc queries) 2 February 13th 07 03:19 PM
Passing Variable Number of Arguments to a Sub blatham Excel Discussion (Misc queries) 4 December 10th 05 10:36 AM
Passing Arguments Grant Reid Excel Programming 8 May 24th 04 01:39 PM
Passing arguments to a sub routine... Jeff Harbin[_2_] Excel Programming 2 January 29th 04 03:25 AM


All times are GMT +1. The time now is 08:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"