View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Schizoid Man[_2_] Schizoid Man[_2_] is offline
external usenet poster
 
Posts: 13
Default How do I declare a function whose output is an array?

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.