ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Refering to Names (https://www.excelbanter.com/excel-programming/327894-refering-names.html)

Vj

Refering to Names
 
I need some help refering to Names having duplicate range name.

I have a worksheet1 in wb1 and A1 cell range name is "rng_Data" and I have
another worksheet2 in wb2 and its A1 cell range name is also "rng_Data". If I
move the worksheet2 into the wb1, then all the ranges also moved to the
workbook1.

Is there any way I can refers to range "rng_Data" of worksheet1 and
worksheet2 separately.?

If i look in the names I see two ranges one is rng_Data and other one is
rng_Data worksheet2.

Can somebody suggest me a way around?

Thanks in advance.



Bob Phillips[_6_]

Refering to Names
 
Debug.Print range("Sheet1!rng_Data").value

--

HTH

RP
(remove nothere from the email address if mailing direct)


"VJ" wrote in message
...
I need some help refering to Names having duplicate range name.

I have a worksheet1 in wb1 and A1 cell range name is "rng_Data" and I have
another worksheet2 in wb2 and its A1 cell range name is also "rng_Data".

If I
move the worksheet2 into the wb1, then all the ranges also moved to the
workbook1.

Is there any way I can refers to range "rng_Data" of worksheet1 and
worksheet2 separately.?

If i look in the names I see two ranges one is rng_Data and other one is
rng_Data worksheet2.

Can somebody suggest me a way around?

Thanks in advance.





Jim Thomlinson[_3_]

Refering to Names
 
So long as you premise the range with the sheet then Excel will resolve the
name correctly...

Sheets("Sheet1").Select
Sheets("Sheet1").Range("rng_Data").Select
Sheets("Sheet2").Select
Sheets("Sheet2").Range("rng_Data").Select


"VJ" wrote:

I need some help refering to Names having duplicate range name.

I have a worksheet1 in wb1 and A1 cell range name is "rng_Data" and I have
another worksheet2 in wb2 and its A1 cell range name is also "rng_Data". If I
move the worksheet2 into the wb1, then all the ranges also moved to the
workbook1.

Is there any way I can refers to range "rng_Data" of worksheet1 and
worksheet2 separately.?

If i look in the names I see two ranges one is rng_Data and other one is
rng_Data worksheet2.

Can somebody suggest me a way around?

Thanks in advance.




All times are GMT +1. The time now is 10:35 PM.

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