PC Review


Reply
Thread Tools Rate Thread

How do I declare a function whose output is an array?

 
 
Schizoid Man
Guest
Posts: n/a
 
      24th May 2006
My current workaround to this problem is to declare the function as

Public Function xyz(abc as Range) as Variant
'Code
'klm is an array
xyz = klm
End Function

This works efficiently enough, but I would like to tidy up my code by
eliminating all non-explicit declarations.

Furthermore, can someone tell me what exactly the difference between an
array and a range is? For example, if I declare the function as

Public Function(abc() as Double) as Variant, how will that make a
difference? Is there any advantage of one over the other?

Will functions like Rows.Count or Application.Count work with an array?

Thank you in advance.
 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      24th May 2006
I believe you have a response in .programming

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Schizoid Man" <(E-Mail Removed)> wrote in message
news:e525mk$jck$(E-Mail Removed)...
> My current workaround to this problem is to declare the function as
>
> Public Function xyz(abc as Range) as Variant
> 'Code
> 'klm is an array
> xyz = klm
> End Function
>
> This works efficiently enough, but I would like to tidy up my code by
> eliminating all non-explicit declarations.
>
> Furthermore, can someone tell me what exactly the difference between an
> array and a range is? For example, if I declare the function as
>
> Public Function(abc() as Double) as Variant, how will that make a
> difference? Is there any advantage of one over the other?
>
> Will functions like Rows.Count or Application.Count work with an array?
>
> Thank you in advance.



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to declare a pointer to array return type for external function? constructor Microsoft C# .NET 0 16th Oct 2008 11:37 AM
Declare and array in a function =?Utf-8?B?RGF2ZQ==?= Microsoft Excel Programming 3 30th Sep 2006 03:41 AM
How do I declare a function whose output is an array? Schizoid Man Microsoft Excel Programming 5 24th May 2006 09:23 PM
Array as output of function maca Microsoft Excel Programming 4 15th Jul 2005 12:59 PM
Declare a user32.dll function to accept an Array Richard A. Lowe Microsoft C# .NET 1 10th Jul 2003 10:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:01 PM.