So I am filling a few static array variables using both randomly generated numbers and values pulled from the spreadsheet. For some reason the values being pulled from the cells are giving me a runtime error 13. I cannot figure out what the problem is. Here is the code.
For i = 0 To 15
For j = 1 To 10
Sheets("Rolls").Cells((10 * i) + j, 13) = TypeR((10 * i) + j)
TypeR((10 * i) + j) = Int((6 * Rnd) + 1) + Int((6 * Rnd) + 1) + Sheets("Animal Tables").Range("B" & (13 + i))
SizeR((10 * i) + j) = Int((6 * Rnd) + 1) + Int((6 * Rnd) + 1) + Sheets("Animal Tables").Range("C" & (13 + i)) + WorksheetFunction.HLookup(MovementR((10 * i) + j), Sheets("Animal Tables").Range("J13:O29"), (1 + i))
Next j
Next i
For i = 0 To 15
For j = 1 To 10
Sheets("Rolls").Cells((10 * i) + j, 13) = TypeR((10 * i) + j)
TypeR((10 * i) + j) = Int((6 * Rnd) + 1) + Int((6 * Rnd) + 1) + Sheets("Animal Tables").Range("B" & (13 + i))
SizeR((10 * i) + j) = Int((6 * Rnd) + 1) + Int((6 * Rnd) + 1) + Sheets("Animal Tables").Range("C" & (13 + i)) + WorksheetFunction.HLookup(MovementR((10 * i) + j), Sheets("Animal Tables").Range("J13:O29"), (1 + i))
Next j
Next i