Copy data from workbooks
Set rngSource(1) = Worksheets("Sheet 1").Range("A8:U79")
Set rngSource(2) = Worksheets("Sheet 2").Range("A7:X10")
Workbooks.Open (SRCbook)
Set myBook = ActiveWorkbook
For i = 1 To UBound(rngSource)
Set sourceRNG = rngSource(i)
would be one guess. rngSource is already a range reference, so it is
specific to the workbook and worksheet to which it refers.
If you want to use the address of that reference to refer to the same range
in another workbook you could do
Set sourceRNG = Mybook.Range(rngSource(i).address)
--
Regards,
Tom Ogilvy
"Andibevan" wrote in message
...
Hi All,
Can someone tell me if the following code is possible:- I get an "Object
does not support this property or method"
Can use arrays in this fashion - Set sourceRNG = myBook.rngSource(i).
I am trying to Open a workbook and copy an array of source ranges to an
array of destination ranges.
Here is an extract from my code:-
Set rngSource(1) = Worksheets("Sheet 1").Range("A8:U79")
Set rngSource(2) = Worksheets("Sheet 2").Range("A7:X10")
Workbooks.Open (SRCbook)
Set myBook = ActiveWorkbook
For i = 1 To UBound(rngSource)
Set sourceRNG = myBook.rngSource(i)
|