VBA Array LBound Function in Excel

VBA Array LBound function

VBA Array LBound Function in Excel. Let us see about VBA arrays lower bound or LBound function in Excel VBA. The LBound function represents the lower bound value of an array. It returns the smallest subscript(Index) value of specified array. It helps to determine the existing an array starting size.

Here is the Syntax of the LBound Function in Excel VBA.


Where ArrayName: It is a mandatory argument. The ArrayName argument represents the name of an array.
Dimension: It is an optional parameter. The Dimension argument represents the dimension of an array.
VBA Array Lbound function

Example for VBA LBound Function in Excel/a>

Let us see the example for VBA lower bound function in Excel.

'VBA LBound Function
Sub VBA_LBound_Function()

    'Declare an array variable
    Dim aNEWS As Variant
    'Define an Array values
    sWeekDays = Array("North", "East", "West", "South")
    'Find Array Lower Bound
    MsgBox "Array Lower Bound Value is :" & LBound(sWeekDays), vbInformation, "VBAF1"
End Sub

Here is the output screen shot of above macro.

VBA LBound function

Instructions to Run VBA Macro Code or Procedure:

You can refer the following link for the step by step instructions.

Instructions to run VBA Macro Code

Other Useful Resources:

Click on the following links of the useful resources. These helps to learn and gain more knowledge.

VBA Tutorial VBA Functions List VBA Arrays VBA Text Files VBA Tables

VBA Editor Keyboard Shortcut Keys List VBA Interview Questions & Answers Blog

Leave a Comment