I am trying to store these selection of values in a Variant data type in a variable ‘stat’.
The value ‘1’ in cell is referenced ‘BodyStart’.
I am then looking to access a particular value at a specific index for example, to return the value 5, stat(2) should give me the answer based on 0-index but this isn’t working sadly. Here is the code:
Dim LR As Long, stat() As Variant
Range("BodyStart").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
stat = Selection.Value
MsgBox stat(2)
I am getting subscript out of range error
Your help will be much appreciated.
Thank You.