Import Data and create charts in Excel sheet using Excel VBA active X combo box drop down selection

praveen123

New Member
Joined
Dec 26, 2012
Messages
2
I am trying to use Excel VBA to import data into my active workbook and then use two combo boxes(which should get populated once the data is imported) drop down menu's to make a selection of any two variables from the data and create a choice of chart(Line, Scatter etc). I have already done the import data part but facing a problem in using combo boxes. Please somebody can guide me in the right direction with the code.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Welcome to MrExcel.

Maybe this will help you:

Select a Chart Type Using a List Box or Drop Down

Hi Andrew ,
Thanks for responding!

I am enclosing a sample table( though this is not fixed)

[TABLE="width: 500"]
<tbody>[TR]
[TD]Date[/TD]
[TD]Var 1[/TD]
[TD]Var 2[/TD]
[TD]Var 3[/TD]
[TD]Var 4[/TD]
[TD]Var 5[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
What I am trying to do is have two drop down menu's which can automatically populate itself with the column headers( here Var 1, Var 2, Var3 etc) and then using these choices to create charts of my choice( line, bar or scatter).

Tasks:
- Two drop downs needed.
- The dropdowns should be dynamic to populate itself with the column headers (var1, var2 var3 etc here) based on the data imported.
- Once the selection is done, chart can be created to analyse to the two selections( line, bar or scatter)

I am really new to VBA and hence facing huge problem in coding for this. Would appreciate your help if you can help out with the code.
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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