VBA Array UBound Function in Excel. Let us see about VBA arrays Upper Bound or UBound function in Excel VBA. The UBound function represents the Upper Bound value of an array. It returns the highest subscript(Index) value of specified array. It helps to determine the existing an array end size.
Syntax of the UBound Function
Here is the Syntax of the UBound Function in Excel VBA.
UBound(ArrayName,[Dimension])
Where ArrayName: It is a mandatory argument. The ArrayName argument represnts the name of an array.
Dimension: It is an optional parameter. The Dimension argument represents the dimension of an array.
Example for VBA UBound Function in Excel
Let us see the example for VBA Upper Bound function in Excel.
'VBA UBound Function Sub VBA_UBound_Function() 'Declare an array variable Dim sWeekDays As Variant 'Define an Array values sWeekDays = Array("North", "East", "West", "South") 'Find Array Upper Bound MsgBox "Upper Bound Value is :" & UBound(sWeekDays), vbInformation, "VBAF1" End Sub
Here is the output screen shot of above macro.
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
Aweѕome!
Hey very interesting blog!
It is tгuly a great and useful piece of info. I’m satisfied that you simply shared this helpful information with
us. Pleaѕe keep us up to date like this. Thank y᧐u fοr sharing.
Thank you everyone!
I used to be suggested this website via my cousin. I am now not sure whether or not this put up
is written via him as no one else recognize such specified about my difficulty.
You’re incredible! Thank you!
Pingback: Neha
Good information. Lucky me I ran across your website by chance (stumbleupon).
I’ve book marked it for later!
Pingback: Google