+ Reply to Thread
Results 1 to 2 of 2

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

  1. #1
    Schizoid Man
    Guest

    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.

  2. #2
    Bob Phillips
    Guest

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

    I believe you have a response in .programming

    --

    HTH

    Bob Phillips

    (remove nothere from the email address if mailing direct)

    "Schizoid Man" <[email protected]> wrote in message
    news:[email protected]...
    > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1