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" <april27@discussions.microsoft.com> wrote in message
news:B9ABDBED-7E55-445E-9B15-45C6CCBF59C4@microsoft.com...
> 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" <bartsmissaert@blueyonder.co.uk> wrote in message
news:ujbjgW6kGHA.3440@TK2MSFTNGP02.phx.gbl...
> Lookup UBound in the VBA help.
>
> Dim Arr(1 to 100) as String
>
> MsgBox UBound(Arr)
>
> This will give 100
>
> RBS
>
> "april27" <april27@discussions.microsoft.com> wrote in message
> news:B9ABDBED-7E55-445E-9B15-45C6CCBF59C4@microsoft.com...
> > 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" <april27@discussions.microsoft.com> wrote in message
> news:B9ABDBED-7E55-445E-9B15-45C6CCBF59C4@microsoft.com...
> > 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