+ Reply to Thread
Results 1 to 3 of 3

UBound of multi-dimensional array?

  1. #1
    Registered User
    Join Date
    07-14-2005
    Posts
    15

    UBound of multi-dimensional array?

    This is a simple question... I'm sure someone out there knows the answer to it...

    I have a 2-D array...

    ReDim A(1 to x, 1 to y)

    I need to know the upper-bound of the second dimension of A (which is y), but UBound(A) only gives me x.

    Thanks,
    Paul

  2. #2
    JE McGimpsey
    Guest

    Re: UBound of multi-dimensional array?

    Take a look at "UBound Function" in VBA Help. It has good examples.


    In article <[email protected]>,
    paulharvey <[email protected]>
    wrote:

    > This is a simple question... I'm sure someone out there knows the answer
    > to it...
    >
    > I have a 2-D array...
    >
    > ReDim A(1 to x, 1 to y)
    >
    > I need to know the upper-bound of the second dimension of A (which is
    > y), but UBound(A) only gives me x.
    >
    > Thanks,
    > Paul


  3. #3
    Jake Marx
    Guest

    Re: UBound of multi-dimensional array?

    Hi Paul,

    You can use the optional second argument to the UBound function.

    From the VB help file:

    dimension: Optional; Variant (Long). Whole number indicating which
    dimension's upper bound is returned. Use 1 for the first dimension, 2 for
    the second, and so on. If dimension is omitted, 1 is assumed.

    --
    Regards,

    Jake Marx
    MS MVP - Excel
    www.longhead.com

    [please keep replies in the newsgroup - email address unmonitored]


    paulharvey wrote:
    > This is a simple question... I'm sure someone out there knows the
    > answer to it...
    >
    > I have a 2-D array...
    >
    > ReDim A(1 to x, 1 to y)
    >
    > I need to know the upper-bound of the second dimension of A (which is
    > y), but UBound(A) only gives me x.
    >
    > Thanks,
    > Paul



+ 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