=range combine the number in 2 cells

Bandito1

Board Regular
Joined
Oct 18, 2018
Messages
233
Office Version
  1. 2016
Platform
  1. Windows
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

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
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?
 
Upvote 0
:) 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!
 
Upvote 0
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).
 
Upvote 0

Forum statistics

Threads
1,214,973
Messages
6,122,534
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top