hi all;
please can any body help me with this:
I'm trying to assign 2 ranges in e sheets into one array
Dim myData() As Variant, Temp As Variant
Dim Obj As Object, I, x, lr As Long
Dim lr1, lr2 As Long
Sheet1.Activate
lr1 = Cells(Rows.Count, 1).End(xlUp).Row
ReDim myData(0 To lr1)
Sheet2.Activate
lr2 = Cells(Rows.Count, 1).End(xlUp).Row
myData = Sheet1.Range("A2:A" & lr1).Value
ReDim Preserve myData(LBound(myData) To LBound(myData), UBound(myData) + 1 To lr1+lr2)
For x = lr1 + 1 To UBound(myData)
myData(x) = Sheet2.Range("A" & x)
Next x
I had reached this far but line in red big problem I could not over come it
any help please
Thanks
please can any body help me with this:
I'm trying to assign 2 ranges in e sheets into one array
Dim myData() As Variant, Temp As Variant
Dim Obj As Object, I, x, lr As Long
Dim lr1, lr2 As Long
Sheet1.Activate
lr1 = Cells(Rows.Count, 1).End(xlUp).Row
ReDim myData(0 To lr1)
Sheet2.Activate
lr2 = Cells(Rows.Count, 1).End(xlUp).Row
myData = Sheet1.Range("A2:A" & lr1).Value
ReDim Preserve myData(LBound(myData) To LBound(myData), UBound(myData) + 1 To lr1+lr2)
For x = lr1 + 1 To UBound(myData)
myData(x) = Sheet2.Range("A" & x)
Next x
I had reached this far but line in red big problem I could not over come it
any help please
Thanks