is there any command (like in java) which gives you the length of an array?
is there any command (like in java) which gives you the length of an array?
Lookup UBound in the VBA help.
Dim Arr(1 to 100) as String
MsgBox UBound(Arr)
This will give 100
RBS
"april27" <[email protected]> wrote in message
news:[email protected]...
> is there any command (like in java) which gives you the length of an
> array?
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)
"RB Smissaert" <[email protected]> wrote in message
news:[email protected]...
> Lookup UBound in the VBA help.
>
> Dim Arr(1 to 100) as String
>
> MsgBox UBound(Arr)
>
> This will give 100
>
> RBS
>
> "april27" <[email protected]> wrote in message
> news:[email protected]...
> > is there any command (like in java) which gives you the length of an
> > array?
>
a more general determination for a single dimension:
Dimensionsize = Ubound(a) - lbound(a) + 1
--
Regards,
Tom Ogilvy
"RB Smissaert" wrote:
> Lookup UBound in the VBA help.
>
> Dim Arr(1 to 100) as String
>
> MsgBox UBound(Arr)
>
> This will give 100
>
> RBS
>
> "april27" <[email protected]> wrote in message
> news:[email protected]...
> > is there any command (like in java) which gives you the length of an
> > array?
>
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks