Using these values for my array I get an overflow error when trying to findthe inverse
A
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
16 17 18 19 20
21 22 23 24 25
Code below(the problem line is indicated as an *):
Sub InvertThis()
Dim marray(5, 5) As Long
Dim harray(5, 5) As Long
Dim iarray(5, 5) As Double
Dim i As Integer
Dim j As Integer
Range("A2").Activate
'First loop to store values from spreadsheet for marray and harray
For i = 0 To 4
For j = 0 To 4
marray(i, j) = ActiveCell.Value
harray(i, j) = ActiveCell.Value
ActiveCell.Offset(0, 1).Activate
Next j
ActiveCell.Offset(1, -5).Activate
Next i
'Second loop to store the inverse matrix iarray
For i = 0 To 4
For j = 0 To 4
*** iarray(i, j) = 1 / harray(i, j)
Next j
Next i
End Sub
Bookmarks