create several chart and command button for show one of them

niksirat2030

New Member
Joined
Nov 16, 2015
Messages
9
I have an Excel with two sheets, Form and DATA, and I designed a form in the Form sheet.

My data is in A1:B10 and D1:E10 in the DATA sheet.

I put two command buttons in the Form sheet whose names are cmdButtonChart1 for the chart related to A1:B10 and cmdButtonChart2 for the chart related to D1:E10.

My goal is that when each button is pressed, the previous chart will be hidden and the bar chart corresponding to that button will be displayed in the Form sheet.

Until now, I have not written the commands related to chart in VBA. Please help me to write that.

Thanks in advance.
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Once again you have cross-posted without supplying a link. Please do so now.
Should you fail to provide links in the future you could find yourself being banned.
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,257
Members
449,075
Latest member
staticfluids

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