length of an array

R

RB Smissaert

Lookup UBound in the VBA help.

Dim Arr(1 to 100) as String

MsgBox UBound(Arr)

This will give 100

RBS
 
B

Bob Phillips

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)
 
G

Guest

a more general determination for a single dimension:

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top