What i am trying to do is loop through a two dimensional array that takes values from their respective cell locations and then display them one at a time in a message box. This simple code works fine until the last iteration is executed. After the last iteration it says that i have "a type mismatch error". any help would be greatly appreciated.
-----here is the code-------
[VBA]Sub arrayfun()
Dim arraytest(1 To 5, 1 To 2) As Double
For j = LBound(arraytest) To UBound(arraytest)
For i = LBound(arraytest) To UBound(arraytest)
arraytest(i, j) = ThisWorkbook.Sheets("sheet1").Cells(i, j).Value
MsgBox (arraytest(i, j))
Next
Next
End Sub[/VBA]