Code:
    If YourSubscript < LBound(TheArray) Or YourSubscript > UBound(TheArray) Then
        MsgBox "Out of Range", vbExclamation
    End If