I'm hoping to create a VBA array with 5 rows and 2 columns
varData = [{0, 0; 0, 0; 0, 0; 0, 0; 0, 0}]
and change the values according to a case
select Case sth
Case "1"
varData(0, 0) = varData(0, 0) + Cells(I, 1).Value
Case "2"
varData(0, 1) = varData(0, 1) + Cells(I, 1).Value
Case "3"
varData(0, 2) = varData(0, 2) + Cells(I, 1).Value
Case "4"
varData(0, 3) = varData(0, 3) + Cells(I, 1).Value
Case "5"
varData(0, 4) = varData(0, 4) + Cells(I, 1).Value
Case Else
'?
End Select
I'm getting an error on this line:
varData(0, 2) = varData(0, 2) + Cells(I, 1).Value
saying "subscript out of range"
I also tried changing the array to
varData = [{0, 0, 0, 0, 0; 0, 0, 0, 0, 0}]
Please help me understand how I'm out of range

varData(0, 0)is the one with the errorMsgBox (varData(0, 0))produces the same error: subscript out of range