Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ubound MultiDimensional arrays 2

Status
Not open for further replies.

intrepid101

Programmer
Aug 8, 2001
13
0
0
US
With an array of:

array(1,10)

an Ubound(array) returns the first Dimension upper '1', is there a way to get the 2nd Dimension upper '10'?
BTW
The reason I am using the largest at the end is ao I can Redim Preserve it, it is the only one that increases.

Thanks
Scott
 
Are you asking about something like...

x = UBound(ary, 1)
y = UBound(ary, 2)

Where "x" gets the upper bound of the 1st dimension of ary, and "y" gets the ubound of the 2nd?

From the online help:

Syntax

UBound(
arrayname[, dimension])

The UBound function syntax has these parts:

Part: arrayname Description:
Required. Name of the array variable; follows standard variable naming conventions.

Part: dimension Description:
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.


Reading the manual can be a big help sometimes ;-)
 
Thanks for the quick (1 hour) reply. That does the trick.

Scott
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top