Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How do you refer to a dynamic named range?

I have a dynamic named range in a spreadsheet called myRange. The
position of this range in the spreadsheet may change.

How can I refer to the contents of this range named "location" in
another spreadsheet?

Example:

myRange=Data!A1:B2
value1 value2
value3 value4

In a new location, say at Results!B2:C4 I want
value1 value2
value3 value4

Under the condition that next time the range could be
myRange=Data!A5:B7 for example.

I tried cutting the range and paste/special, but it always refers to
the range as cell references in the new sheet.

Ian Staines
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How do you refer to a dynamic named range?

assume I have a named range in an open workbook named Check_Proc.xls. The
range is named myRange and it is a 4 cell square

Pick a 4 cell square in another open workbook and enter

=check_proc.xls!myRange

in the formula bar. Enter with Ctrl+Shift+Enter rather than just enter
since this is an array formula.

You should then see the values from the named range myRange.

If you meant in code, since you posted in programming

Dim rng as Range
set rng = workbooks("Check_proc.xls").Names("myRange").Refer stoRange




--
Regards,
Tom Ogilvy


Ian Staines wrote in message
m...
I have a dynamic named range in a spreadsheet called myRange. The
position of this range in the spreadsheet may change.

How can I refer to the contents of this range named "location" in
another spreadsheet?

Example:

myRange=Data!A1:B2
value1 value2
value3 value4

In a new location, say at Results!B2:C4 I want
value1 value2
value3 value4

Under the condition that next time the range could be
myRange=Data!A5:B7 for example.

I tried cutting the range and paste/special, but it always refers to
the range as cell references in the new sheet.

Ian Staines



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How do you refer to a dynamic named range?

Thanks Tom

I had not thought about using arrays. This seems to be a good solution.
I am still experimenting with what happens when size of the original named
range changes with inserts and deletes.

I also tried using a series of references using offsets,
=OFFSET(myRange,0,0), but you have to set up each target cell individually.

Thanks

Ian Staines

"Tom Ogilvy" wrote in message
...
assume I have a named range in an open workbook named Check_Proc.xls. The
range is named myRange and it is a 4 cell square

Pick a 4 cell square in another open workbook and enter

=check_proc.xls!myRange

in the formula bar. Enter with Ctrl+Shift+Enter rather than just enter
since this is an array formula.

You should then see the values from the named range myRange.

If you meant in code, since you posted in programming

Dim rng as Range
set rng = workbooks("Check_proc.xls").Names("myRange").Refer stoRange




--
Regards,
Tom Ogilvy


Ian Staines wrote in message
m...
I have a dynamic named range in a spreadsheet called myRange. The
position of this range in the spreadsheet may change.

How can I refer to the contents of this range named "location" in
another spreadsheet?

Example:

myRange=Data!A1:B2
value1 value2
value3 value4

In a new location, say at Results!B2:C4 I want
value1 value2
value3 value4

Under the condition that next time the range could be
myRange=Data!A5:B7 for example.

I tried cutting the range and paste/special, but it always refers to
the range as cell references in the new sheet.

Ian Staines





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How do you refer to a dynamic named range?

Not necessarily.

In the upper left corner:

=OFFSET(check_proc.xls!myRange,Row(A1)-1,Column(A1)-1)

then drag fill right and down.



--
Regards,
Tom Ogilvy

Ian Staines wrote in message
...
Thanks Tom

I had not thought about using arrays. This seems to be a good solution.
I am still experimenting with what happens when size of the original named
range changes with inserts and deletes.

I also tried using a series of references using offsets,
=OFFSET(myRange,0,0), but you have to set up each target cell

individually.

Thanks

Ian Staines

"Tom Ogilvy" wrote in message
...
assume I have a named range in an open workbook named Check_Proc.xls.

The
range is named myRange and it is a 4 cell square

Pick a 4 cell square in another open workbook and enter

=check_proc.xls!myRange

in the formula bar. Enter with Ctrl+Shift+Enter rather than just enter
since this is an array formula.

You should then see the values from the named range myRange.

If you meant in code, since you posted in programming

Dim rng as Range
set rng = workbooks("Check_proc.xls").Names("myRange").Refer stoRange




--
Regards,
Tom Ogilvy


Ian Staines wrote in message
m...
I have a dynamic named range in a spreadsheet called myRange. The
position of this range in the spreadsheet may change.

How can I refer to the contents of this range named "location" in
another spreadsheet?

Example:

myRange=Data!A1:B2
value1 value2
value3 value4

In a new location, say at Results!B2:C4 I want
value1 value2
value3 value4

Under the condition that next time the range could be
myRange=Data!A5:B7 for example.

I tried cutting the range and paste/special, but it always refers to
the range as cell references in the new sheet.

Ian Staines







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
make camera object refer to dynamic range Mica Excel Discussion (Misc queries) 0 March 27th 10 12:14 AM
Refer to a named range indirectly tberkom Excel Worksheet Functions 1 May 13th 09 12:33 AM
Refer to Named Range on another sheet for IF function David Excel Worksheet Functions 3 August 26th 06 04:12 AM
???Refer to a specifc cell in a named range Jaylin Excel Worksheet Functions 1 February 10th 06 11:47 AM
How does one refer to the n-1 element of a named range? Charles Hewitt Excel Discussion (Misc queries) 2 November 26th 05 06:56 AM


All times are GMT +1. The time now is 02:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"