+ Reply to Thread
Results 1 to 4 of 4

Effective Method to Detemine the Beginning and End of An Array?

Hybrid View

  1. #1
    silver23
    Guest

    Re: Effective Method to Detemine the Beginning and End of An Array

    Passing range A1:A20 works because the udf is coded to identify positive
    changes between cells A1:A2 and A2:A3. If I attempt to pass A20:A1, however,
    the udf receives A1:A20. In turn, it interprets what are actually negative
    changes between cells as positive changes; defeating the purpose of the udf.
    How does one pass A20:A1 to a macro/udf? Or is it necessary to pass a second
    token, i.e.

    Function myUDF(rng As Range, num as Double)

    to identify the starting position?

    "Bob Phillips" wrote:

    > Why would you not just pass the range to the function
    >
    > Function myUDF(rng As Range)
    >
    > For Each cell in rng
    > 'do something
    > Next cell
    >
    > End Function


  2. #2
    Bob Phillips
    Guest

    Re: Effective Method to Detemine the Beginning and End of An Array

    The latter is the simpler way IMO.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "silver23" <silver23@discussions.microsoft.com> wrote in message
    news:FD8D1ABC-E705-424F-8934-28BE388D3587@microsoft.com...
    > Passing range A1:A20 works because the udf is coded to identify positive
    > changes between cells A1:A2 and A2:A3. If I attempt to pass A20:A1,

    however,
    > the udf receives A1:A20. In turn, it interprets what are actually

    negative
    > changes between cells as positive changes; defeating the purpose of the

    udf.
    > How does one pass A20:A1 to a macro/udf? Or is it necessary to pass a

    second
    > token, i.e.
    >
    > Function myUDF(rng As Range, num as Double)
    >
    > to identify the starting position?
    >
    > "Bob Phillips" wrote:
    >
    > > Why would you not just pass the range to the function
    > >
    > > Function myUDF(rng As Range)
    > >
    > > For Each cell in rng
    > > 'do something
    > > Next cell
    > >
    > > End Function




+ 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