Determine the First and Last Index Number of an Array in VBA
This Excel VBA macro tutorial shows you how to find the first and last index number of an array variable. These index numbers are also referred to as the lower and upper bounds of an array variable. This information is very helpful when trying to loop through an array or access its contents.
Tutorial Length (mm:ss): |
4:49 |
Sign Up to View Tutorials
|
Downloadable Files: |
Yes |
Microsoft Office Program: |
Microsoft Office Excel |
|
|
Keywords: |
training excel macro vba visual basic determine first last upper lower bound index number array |
This Excel VBA macro tutorial shows you how to create a dynamic array variable in vba and macros. This tutorial covers how to declare a dynamic array; how to size a dynamic array; how to resize a dynamic array; how to input and output values from an array variable; and how to add values or elements to an array variable without deleting previously stored elements within the array. This is a comprehensive overview and explanation of dynamic arrays in vba and macros.
Tutorial Length (mm:ss): |
19:36 |
Microsoft Office Program: |
Microsoft Office Excel |
|
|
Keywords: |
training excel macro vba visual basic array arrays dynamic declare create insert redim preserve elements values input output |
This Excel VBA macro tutorial shows you how to loop through a static array variable in VBA. This tutorial will show you how to use a For Next Loop in order to quickly add elements or items to an array variable and also to quickly retrieve or get elements from a static array variable. This technique is very useful and will help you streamline your VBA code.
Tutorial Length (mm:ss): |
8:23 |
Microsoft Office Program: |
Microsoft Office Excel |
|
|
Keywords: |
training excel macro vba visual basic static basic array variable loop through retrieve pull values elements |
This Excel VBA macro tutorial shows you how to loop through the elements contained within a dynamic array variable in VBA. This tutorial will show you how to use a For Next Loop in order to access each of the elements within a dynamic array. This is a little tricky with a dynamic array because you need to dynamically reference the upper and lower bounds of the array variable. This tutorial is a must view for anyone who works with dynamic arrays in VBA.
Tutorial Length (mm:ss): |
8:52 |
Microsoft Office Program: |
Microsoft Office Excel |
|
|
Keywords: |
training excel macro vba visual basic loop through dynamic array elements retrieve output view upper lower bound |
This Excel VBA macro tutorial shows you how to increase and decrease the size of a dynamic array variable in VBA. This is the same as increasing or decreasing the index number or lower and upper bounds of a dynamic array and will allow you to put more elements into a dynamic array. This is the feature of a dynamic array that actually makes it dynamic.
Tutorial Length (mm:ss): |
6:30 |
Microsoft Office Program: |
Microsoft Office Excel |
|
|
Keywords: |
training excel macro vba visual dynamic array increase decrease size upper lower bound index number store elements |
This Excel VBA macro tutorial shows you how to add elements to a dynamic array variable in VBA. This tutorial will also cover how to prevent previous elements in the array from being erased when you add a new element to the array. This is especially important when you need to increase the size of the array in order to add an extra element or multiple new elements to the array, which is also covered in this tutorial.
Tutorial Length (mm:ss): |
5:45 |
Microsoft Office Program: |
Microsoft Office Excel |
|
|
Keywords: |
training excel macro vba visual basic dynamic array variable insert add elements values size increase |
This Excel VBA macro tutorial shows you how to quickly add elements to a dynamic array using a loop. The loop used for this example is a For Next Loop. This tutorial covers how to use variables instead of hard coded values to resize a dynamic array and then to add a new element to the array.
Tutorial Length (mm:ss): |
8:16 |
Microsoft Office Program: |
Microsoft Office Excel |
|
|
Keywords: |
training excel macro vba visual dynamic array add elements items values loop for next quickly |
This Excel VBA macro tutorial shows you how to clear or erase all of the items contained within a static array variable. This means that all text strings will be turned into empty strings and all numbers will be turned into zeros. However, this method will not change or alter the size of the static array.
Tutorial Length (mm:ss): |
5:50 |
Microsoft Office Program: |
Microsoft Office Excel |
|
|
Keywords: |
training excel macro vba visual basic static array variable clear remove erase delete values items elements |
This Excel VBA macro tutorial shows you two different ways to clear or delete all of the values from a dynamic array in VBA. This is a very important thing to know how to do with dynamic arrays because it will allow you to free memory that your macro or program is using. One of the methods in this tutorial will allow you to retain the array’s size while the other one will completely remove or delete the array’s size along with the data contained within the array variable.
Tutorial Length (mm:ss): |
5:35 |
Microsoft Office Program: |
Microsoft Office Excel |
|
|
Keywords: |
training excel macro vba visual basic dynamic array clear erase delete values elements items |
This Excel VBA macro tutorial shows you how to check if a variable is an array variable or a regular variable in VBA. This method works the same for static and dynamic array variables.
Tutorial Length (mm:ss): |
3:14 |
Microsoft Office Program: |
Microsoft Office Excel |
|
|
Keywords: |
training excel macro vba visual basic isarray variable array check determine static dynamic |
This Excel VBA macro tutorial shows you how to set or declare the lower bound or first index number of an array in VBA. You will learn how to control the number for the lower bound of an array variable and how to set this for specific arrays as well as for all of the arrays within a macro.
Tutorial Length (mm:ss): |
7:32 |
Microsoft Office Program: |
Microsoft Office Excel |
|
|
Keywords: |
training excel macro vba visual basic array static dynamic first index number lower bound option base set |