[vba]Option Explicit
Sub Main()
Dim MyArray(1 To 12) As Integer
Dim i As Variant
Dim n As Variant
n = Sheets("Analysis").Range("A1").Value
For i = 0 To n
MyArray(i) = Sheets("Analysis").Cells(22, i + 7).Value
Next i
End Sub[/vba]
edit: the error highlights the MyArray line, saying there is an invalid range