=range combine the number in 2 cells

Bandito1

Board Regular
Joined
Oct 18, 2018
Messages
85
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?
 

Some videos you may like

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
Joined
Jun 27, 2017
Messages
70
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?
 

CatyH

Board Regular
Joined
Jun 27, 2017
Messages
70
:) 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
Joined
Oct 18, 2018
Messages
85
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).
 

Watch MrExcel Video

Forum statistics

Threads
1,108,732
Messages
5,524,513
Members
409,583
Latest member
RedHelp

This Week's Hot Topics

Top