How to Find Upper Bound & Lower Bound on Excel
- 1). Right-click the XLS or XLSX file you want to edit and select "Open With." Click "Microsoft Excel" to open the software and load the spreadsheet.
- 2). Click the "Developer" ribbon or tab. Click the "VBA" button to open the VBA coding environment. Double-click the file that contains your arrays.
- 3). Create two variables to contain the upper and lower bounds of the array. The following code creates two variables in VBA:
Dim lower As Integer
Dim upper As Integer - 4). Retrieve the upper and lower bounds of the array. The following code returns the upper and lower bounds of values for the array "myarray":
lower = LBound(myarray)
upper = UBound(myarray)
Replace "myarray" with the array you want to evaluate.
Source...