length of an array

  • Thread starter Thread starter Guest
  • Start date Start date
Lookup UBound in the VBA help.

Dim Arr(1 to 100) as String

MsgBox UBound(Arr)

This will give 100

RBS
 
Use

UBound(Arr) - LBound(Arr) + 1

in case it doesn't start at 1.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
a more general determination for a single dimension:

Dimensionsize = Ubound(a) - lbound(a) + 1
 
Back
Top