I get 2 different types of errors depending on how I Dim my array. I selected 4 cells when I ran the code below and it throws the error, "subscript out of range" on "MyArray(i, 1) = 1", when i = 1.
Dim MyArray() As Variant
ReDim MyArray(1 To Selection.Cells.Count, 1 To 3) As Variant
Dim i As Integer
For Each c In Selection.Cells
i = i + 1
MyArray(i, 1) = 1
MyArray(i, 2) = 2
MyArray(i, 3) = "awesome"
Next c
Then when I ran the code by changing the () from the first line, I get Type Mismatch on the MyArray(i,1) line:
Help! I'm new to arrays and have read through a few tutorials but this is my first time trying one.
Bookmarks