[RESOLVED] Name Range in Seperate .xls
I am trying to open a different .xls file and copy an area, then paste the area into the current spreadsheet.
I have:
Code:
Workbooks.Open Filename:="Blah Blah Blah"
Range("A2:G82").Select
Selection.Copy
However, when running this, I get:
"Select method of Range class failed"
What am I missing?
Re: Name Range in Seperate .xls
That's because you just opened the other workbook, and don't refer to it with the Range method. If you don't supply a workbook and sheet, the active ones are assumed (in this case, likely to be the sheet that was already visible).
Try this instead:
VB Code:
Dim oWorkBook as WorkBook
Set oWorkBook = Workbooks.Open (Filename:="Blah Blah Blah")
oWorkBook.Sheets("[i]Sheet1[/i]").Range("A2:G82").Select
Selection.Copy
Re: Name Range in Seperate .xls
Thought it was along that line...but wasnt sure how to do it.
You Rock!
Thanks!