Hi All,
So I would like, if possible, to be able to copy 2 columns of text (whose length will vary) from another open workbook into the my active workbook. I believe I have to use the index method of identifying the workbook that i would like to copy the column of text from as the name of that workbook will change. I cannot have anycode in the workbook i am copying from. I've been playing around with variations of the code below just trying to get one column to copy, to no avail. Any thoughts would be greatly appreciated.
So I would like, if possible, to be able to copy 2 columns of text (whose length will vary) from another open workbook into the my active workbook. I believe I have to use the index method of identifying the workbook that i would like to copy the column of text from as the name of that workbook will change. I cannot have anycode in the workbook i am copying from. I've been playing around with variations of the code below just trying to get one column to copy, to no avail. Any thoughts would be greatly appreciated.
Code:
[FONT=Verdana]Sub getinfo()[/FONT]
[FONT=Verdana]'Workbooks(2).Activate
Dim r() As Variant
Dim r1 As Range[/FONT]
[FONT=Verdana]
With Workbooks(2)
r1 = Range("H1", Range("H1").End(xlDown)).Select
End With[/FONT]
[FONT=Verdana]
Range("H1", Range("H1").End(xlDown)).Offset(0, 1).Select[/FONT]
[FONT=Verdana]
End Sub
[/FONT]