Tutorial by Examples

Declaring an array is very similar to declaring a variable, except you need to declare the dimension of the Array right after its name: Dim myArray(9) As String 'Declaring an array that will contain up to 10 strings By default, Arrays in VBA are indexed from ZERO, thus, the number inside the par...
Split Function returns a zero-based, one dimensional array containing a specified number of substrings. Syntax Split(expression [, delimiter [, limit [, compare]]]) PartDescriptionexpressionRequired. String expression containing substrings and delimiters. If expression is a zero-length string(&q...
For...Next Using the iterator variable as the index number is the fastest way to iterate the elements of an array: Dim items As Variant items = Array(0, 1, 2, 3) Dim index As Integer For index = LBound(items) To UBound(items) 'assumes value can be implicitly converted to a String: D...
Dynamic Arrays Adding and reducing variables on an array dynamically is a huge advantage for when the information you are treating does not have a set number of variables. Adding Values Dynamically You can simply resize the Array with the ReDim Statement, this will resize the array but to if you ...
Jagged Arrays NOT Multidimensional Arrays Arrays of Arrays(Jagged Arrays) are not the same as Multidimensional Arrays if you think about them visually Multidimensional Arrays would look like Matrices (Rectangular) with defined number of elements on their dimensions(inside arrays), while Jagged arra...
Multidimensional Arrays As the name indicates, multi dimensional arrays are arrays that contain more than one dimension, usually two or three but it can have up to 32 dimensions. A multi array works like a matrix with various levels, take in example a comparison between one, two, and three Dimensi...

Page 1 of 1