ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Named Range in ANOTHER workbook (https://www.excelbanter.com/excel-discussion-misc-queries/22245-named-range-another-workbook.html)

frtklau

Named Range in ANOTHER workbook
 

hi
I have defined many NamedRanges in 2 workbooks. and copying between
NamedRange(s) between the 2 workbooks is desired.

I have a need to access THOSE NamedRanges from the 3rd book, thus I
need some reference method like:
wb_s.range("ThisRange")
wb_t.range("ThatRange")
<do not prefer BOOK.SHEET.RANGE way

so that I can do
dim A as Variant
A = wb_s.range("From")
wb_t.range("To")=A

if refencing like BOOK.Range(Name) is not feasible, then
dim A as Variant
wb_s.activate
A = range("From")
wb_t.activate
range("To")=A
but this is not clean.

Is Book.Range("MyName") possible?

Frankie.


--
frtklau

Dave Peterson

maybe:

Dim myBook As Workbook
Set myBook = Workbooks("book2.xls")

myBook.Names("thisrange").RefersToRange.Copy _
Destination:=ActiveSheet.Range("a1")



frtklau wrote:

hi
I have defined many NamedRanges in 2 workbooks. and copying between
NamedRange(s) between the 2 workbooks is desired.

I have a need to access THOSE NamedRanges from the 3rd book, thus I
need some reference method like:
wb_s.range("ThisRange")
wb_t.range("ThatRange")
<do not prefer BOOK.SHEET.RANGE way

so that I can do
dim A as Variant
A = wb_s.range("From")
wb_t.range("To")=A

if refencing like BOOK.Range(Name) is not feasible, then
dim A as Variant
wb_s.activate
A = range("From")
wb_t.activate
range("To")=A
but this is not clean.

Is Book.Range("MyName") possible?

Frankie.

--
frtklau


--

Dave Peterson


All times are GMT +1. The time now is 05:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com