Grab the Free VBA Quick Reference Guide
https://www.chrisjterrell.com/excel-vba-quick-reference-guide/
In this video, you will see how to declare an array by using DIM and we set the dimensions of a one dimensional and two-dimensional array. We also show how to add info into the array using the index of the array.
What are Arrays in Excel VBA?
An array is a collection, container, or group of variables.
How do you declare arrays in VBA? See Code below
Sub array_code()
Dim oarray(1 To 3)
oarray(1) = "This"
oarray(2) = "is"
oarray(3) = "An Array"
Dim tarray(1 To 3, 1 To 3)
tarray(1, 1) = "This"
tarray(2, 1) = "is"
tarray(3, 1) = "A two Dimensional Array"
tarray(1, 1) = "This"
tarray(1, 2) = "is"
tarray(1, 3) = "A two Dimensional Array"
End Sub
Download
0 formats
No download links available.
What is an Array in Excel VBA (Dim a 1 and 2 Dimensional Array) - Code Included | NatokHD