i'm trying to do a macro where i will need an array of values. this array is created from a range which will be variable in size. i've tried the below but keep having an error:
Sub chase()
Dim rng As Range
Dim myarray() As Variant
last = Range("r1").End(xlDown).Address
MsgBox last
myarray = Range("r1:" & last).Value
For i = LBound(myarray) To UBound(myarray)
msg = msg & myarray(i) & vbNewLine
Next i
MsgBox "the values of my dynamic array are: " & vbNewLine & msg
End Sub
any idea how to process?
thanks