LBOUND

LBOUND(arrayname [,dimension])

Returns the lower limit in a given dimension of an array (Long).


arraynameThe array (Variant).
dimension(Optional) The number of the dimension to use (Long).

REMARKS
* You cannot prefix this function with "VBA."
* If "dimension" = 1, then the first dimension of the array is used.
* If "dimension" = 2, then the second dimension of the array is used.
* If "dimension" is left blank, then 1 is used.
* The default lower bound for any dimension is 0 unless it has been explicitly changed (either by using To or Option Base).
* You can use the UBOUND function to return the upper limit in a given dimension of an array.
* The equivalent .NET function is [[Microsoft.VisualBasic.Information.LBound]]
* This function is not available in Access.
* For the Microsoft documentation refer to learn.microsoft.com

Dim aValues(10) As Double 
Debug.Print LBound(aValues) '= 0

Dim aValues(1 To 10) As Double
Debug.Print LBound(aValues) '= 1

Dim avTemporary(1 To 100, 0 To 3, -3 To 4) As String
Debug.Print LBound(avTemporary) '= 1
Debug.Print LBound(avTemporary, 1) '= 1
Debug.Print LBound(avTemporary, 2) '= 0
Debug.Print LBound(avTemporary, 3) '= -3

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited Top