Eric58132
07-17-2009, 11:00 AM
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
edit: the error highlights the MyArray line, saying there is an invalid range
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
edit: the error highlights the MyArray line, saying there is an invalid range