Bar graph with selection of combobox

amitjulius

New Member
Joined
Jun 10, 2016
Messages
2
I know there are lots of articles and videos on this title. But I have search a lot all over the internet and has not found what I am looking for.

I will try to explain with an example. Any help is greatly appreciated.

Example:
[TABLE="width: 353"]
<colgroup><col><col><col span="3"></colgroup><tbody>[TR]
[TD]Category
[/TD]
[TD]Sub Category
[/TD]
[TD]Data 1
[/TD]
[TD]Data 2
[/TD]
[TD]Data 3
[/TD]
[/TR]
[TR]
[TD]Category A
[/TD]
[TD]Sub Category A1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]4
[/TD]
[/TR]
[TR]
[TD]Category A[/TD]
[TD]Sub Category A2[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]6
[/TD]
[/TR]
[TR]
[TD]Category B[/TD]
[TD]Sub Category B1[/TD]
[TD="align: right"]22[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]8
[/TD]
[/TR]
[TR]
[TD]Category B[/TD]
[TD]Sub Category B2[/TD]
[TD="align: right"]12[/TD]
[TD="align: right"]90[/TD]
[TD="align: right"]10
[/TD]
[/TR]
[TR]
[TD]Category B[/TD]
[TD]Sub Category B3[/TD]
[TD="align: right"]22[/TD]
[TD="align: right"]34[/TD]
[TD="align: right"]12
[/TD]
[/TR]
[TR]
[TD]Category B[/TD]
[TD]Sub Category B4[/TD]
[TD="align: right"]32[/TD]
[TD="align: right"]12[/TD]
[TD="align: right"]14
[/TD]
[/TR]
[TR]
[TD]Category C
[/TD]
[TD]Sub Category C1[/TD]
[TD="align: right"]42[/TD]
[TD="align: right"]17[/TD]
[TD="align: right"]16
[/TD]
[/TR]
[TR]
[TD]Category C[/TD]
[TD]Sub Category C2[/TD]
[TD="align: right"]52[/TD]
[TD="align: right"]31[/TD]
[TD="align: right"]18
[/TD]
[/TR]
[TR]
[TD]Category D[/TD]
[TD]Sub Category D1[/TD]
[TD="align: right"]62[/TD]
[TD="align: right"]41[/TD]
[TD="align: right"]20
[/TD]
[/TR]
[TR]
[TD]Category D[/TD]
[TD]Sub Category D3[/TD]
[TD="align: right"]46[/TD]
[TD="align: right"]78[/TD]
[TD="align: right"]22
[/TD]
[/TR]
[TR]
[TD]Category D[/TD]
[TD]Sub Category D4[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]33[/TD]
[TD="align: right"]24
[/TD]
[/TR]
</tbody>[/TABLE]

This is on worksheet1 - Called Data.
I want to create a Dashboard on worksheet2.

On worksheet2 I created an ActiveX combobox called "Category" in which I have unique Categories from column A.

On selection of a category from Category combobox, say "Category A", I want a bar graph with following data range:

[TABLE="width: 273"]
<colgroup><col><col span="3"></colgroup><tbody>[TR]
[TD][TABLE="width: 273"]
<colgroup><col><col span="3"></colgroup><tbody>[TR]
[TD]Sub Category A1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD]Sub Category A2[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]6[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
</tbody>[/TABLE]
On selection of a category from Category combobox, say "Category B", I want a bar graph with following data range:

[TABLE="width: 273"]
<colgroup><col><col span="3"></colgroup><tbody>[TR]
[TD]Sub Category B1[/TD]
[TD="align: right"]22[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD]Sub Category B2[/TD]
[TD="align: right"]12[/TD]
[TD="align: right"]90[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD]Sub Category B3[/TD]
[TD="align: right"]22[/TD]
[TD="align: right"]34[/TD]
[TD="align: right"]12[/TD]
[/TR]
[TR]
[TD]Sub Category B4[/TD]
[TD="align: right"]32[/TD]
[TD="align: right"]12[/TD]
[TD="align: right"]14[/TD]
[/TR]
</tbody>[/TABLE]

and so on.

If I add more Categories or more Sub Categories under the existing category, it should be considered.

How can this be done?

I have the same excel that I can share.
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
9k=


2Q==
 
Upvote 0

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

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