VBA create dynamic graph from two columns

papakos

New Member
Joined
Apr 10, 2017
Messages
12
Here is my problem

I have a user form contains a ListBox that been populated from column A. It's ok fixed that.
I have 3 commandbuttons (TEMP, HUMIDITY,RAIN) and one PictureBox.
I'm trying to create a graph that contains x axis= Jan, Feb, Mar, Apr, May, Jun and y-axis the values from cells under TEMP etc
The graph will be displayed in PictureBox when i press one of the 3 commandButtons and will be depending from the selection of ListBox(ALASKA etc)

TEMPHUMIDITYRAIN
ALASKAJAN-595154
FEB-792124
MAR18888
APR57454
MAY96522
JUN18481
ALABAMAJAN34525
FEB75838
MAR145524
APR194358
MAY222341
JUN25217
BOSTONJUN16569
FEB37658
MAR46841
APR95934
MAY14394
JUN22332
TEXASJAN87818
FEB116521
MAR13455
APR20314
MAY24290
JUN31231

<tbody>
</tbody>
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
papakos, you haven't clearly stated your problem or asked a question. What have you tried and where are you running into difficulty?

You have a typo in your posted data: BOSTON has two JUNs.

Your data layout in post #1 may reflect your spreadsheet layout. While blank rows and empty cells sometimes make it easier for humans to read, that layout creates difficulties when we use a computer to sort and filter the data. Formulas and programs are much easier to write when a flat file data structure is used.

If you're having problems creating the dynamic chart, I've posted a non-VBA spreadsheet using your data at https://www.dropbox.com/s/256t23m52xgmo5b/2017-12-19_weather_dynamic_chart.xlsx?dl=0. I've used data validation dropdowns for the user to select the data to display.

I am sorry I can't help you transfer the chart to your VBA userform, but perhaps what I've shown in my spreadsheet will help you.
 
Upvote 0

Forum statistics

Threads
1,215,360
Messages
6,124,489
Members
449,166
Latest member
hokjock

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