Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,355
Default Variable names for named range

I'd like to reference a named range that is variable.

Let's say I have a Range called "Program_1_2" and A1 = 1 and B1 = 2

How do I do something like this "Program_"&A1&"_"&B1 and get it to display?

Thanks,
Barb Reinhardt
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,440
Default Variable names for named range

Hi Barb,

=INDIRECT("Program_"&A1&"_"&B1)

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Barb Reinhardt" wrote in message
...
| I'd like to reference a named range that is variable.
|
| Let's say I have a Range called "Program_1_2" and A1 = 1 and B1 = 2
|
| How do I do something like this "Program_"&A1&"_"&B1 and get it to display?
|
| Thanks,
| Barb Reinhardt


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,355
Default Variable names for named range

I should have posted that I tried using that before I posted this request and
I get a #REF error.

"Niek Otten" wrote:

Hi Barb,

=INDIRECT("Program_"&A1&"_"&B1)

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Barb Reinhardt" wrote in message
...
| I'd like to reference a named range that is variable.
|
| Let's say I have a Range called "Program_1_2" and A1 = 1 and B1 = 2
|
| How do I do something like this "Program_"&A1&"_"&B1 and get it to display?
|
| Thanks,
| Barb Reinhardt



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,440
Default Variable names for named range

Hi Barb,

Are there any invisible characters in A1 or B1? Check with the LEN() function.
I assume you use A1 reference style, not R1C1.

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Barb Reinhardt" wrote in message
...
|I should have posted that I tried using that before I posted this request and
| I get a #REF error.
|
| "Niek Otten" wrote:
|
| Hi Barb,
|
| =INDIRECT("Program_"&A1&"_"&B1)
|
| --
| Kind regards,
|
| Niek Otten
| Microsoft MVP - Excel
|
| "Barb Reinhardt" wrote in message
| ...
| | I'd like to reference a named range that is variable.
| |
| | Let's say I have a Range called "Program_1_2" and A1 = 1 and B1 = 2
| |
| | How do I do something like this "Program_"&A1&"_"&B1 and get it to display?
| |
| | Thanks,
| | Barb Reinhardt
|
|
|


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,355
Default Variable names for named range

No invisible characters
I'm also using the A1 reference style.



"Niek Otten" wrote:

Hi Barb,

Are there any invisible characters in A1 or B1? Check with the LEN() function.
I assume you use A1 reference style, not R1C1.

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Barb Reinhardt" wrote in message
...
|I should have posted that I tried using that before I posted this request and
| I get a #REF error.
|
| "Niek Otten" wrote:
|
| Hi Barb,
|
| =INDIRECT("Program_"&A1&"_"&B1)
|
| --
| Kind regards,
|
| Niek Otten
| Microsoft MVP - Excel
|
| "Barb Reinhardt" wrote in message
| ...
| | I'd like to reference a named range that is variable.
| |
| | Let's say I have a Range called "Program_1_2" and A1 = 1 and B1 = 2
| |
| | How do I do something like this "Program_"&A1&"_"&B1 and get it to display?
| |
| | Thanks,
| | Barb Reinhardt
|
|
|



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
automatic range - named range give me circular reference... George Thorogood Excel Discussion (Misc queries) 0 February 22nd 07 07:53 PM
Array as a "named range" - formula ok in cells, but error as "named range" tskogstrom Excel Discussion (Misc queries) 11 December 28th 06 04:44 PM
inserting a named range into new cells based on a named cell Peter S. Excel Discussion (Misc queries) 1 June 4th 06 03:53 AM
using a "variable" in range names Adam Kroger Excel Discussion (Misc queries) 9 December 11th 05 07:17 PM
DDE linking with variable from named cell! Ben Joiner Links and Linking in Excel 1 March 24th 05 11:32 PM


All times are GMT +1. The time now is 09:37 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"