Variable names for named range

B

Barb Reinhardt

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
 
N

Niek Otten

Hi Barb,

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

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

| 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
 
B

Barb Reinhardt

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

Niek Otten

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

|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
| >
| > | > | 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
| >
| >
| >
 
Top