# =range combine the number in 2 cells

#### Bandito1

##### Board Regular
Hi all,

I use the following line to determine what chart will be visible;

Code:
``SelectedChart = "Chart" & Range("B16")``

Now i would like that 2 cells determine what chart will be visible.

So let's say B16 contains the number "1" and cell B17 contains the number "1" the selected chart would be "11"
When B16 contains the number "1" and cell B17 contains the number "2" the selected chart would be "12".

I tried the following line of code but that didn't work;

Code:
``SelectedChart = "Chart" & Range("B16", "B17")``

Anyone knows how to put the number in B17 behind the number in B17 in formula?

### Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

#### CatyH

##### Board Regular
Can you concatenate in the _worksheet_ prior to referencing range in VB?
That is, maybe you have B18 = B16&B17 and then your Range("B18")?

Hi all,

I use the following line to determine what chart will be visible;

Code:
``SelectedChart = "Chart" & Range("B16")``

Now i would like that 2 cells determine what chart will be visible.

So let's say B16 contains the number "1" and cell B17 contains the number "1" the selected chart would be "11"
When B16 contains the number "1" and cell B17 contains the number "2" the selected chart would be "12".

I tried the following line of code but that didn't work;

Code:
``SelectedChart = "Chart" & Range("B16", "B17")``

Anyone knows how to put the number in B17 behind the number in B17 in formula?

#### Bandito1

##### Board Regular
That's a brilliant idea.
I'm gonna try it out!

#### CatyH

##### Board Regular
Let me know how (if) it works!
I just tried a change-event on a concatenated formula that didn't end up working because thought the contents of the cells were changing, it wasn't registering as such... but maybe your deal will work (fingers crossed!)

That's a brilliant idea.
I'm gonna try it out!

#### Bandito1

##### Board Regular
I just combined the two number from the 2 cells in 1 cell and used that number to show a chart.

So my charts are named for example 11 (both cells 1).

#### CatyH

##### Board Regular
So your chart selector is working?

Replies
8
Views
43
Replies
4
Views
104
Replies
0
Views
54
Replies
22
Views
757
Replies
16
Views
129