Hello,

I have defined a dynamic array called Steps(). I am trying to store the value of a cell in it. But I am getting the error: Runtime error '9'. Subscripts out of range. Not sure what's wrong?



X = Range(ActiveCell.Address, ActiveCell.End(xlDown)).Count

Dim Steps() As Integer

For j = 1 To X Step 1

    Steps(j - 1) = ActiveCell.Offset(0, 7 + j).Value
    MsgBox Steps(j - 1)

Next j

Thanks in Advance.. Anil