Hello,
Please excuse my VBA, it's terrible.
But I have a bar chart in Excel at the moment I have the following code to add a series:
If Sheets("Intro").OLEObjects("Checkbox1").Object.Value = True Then
Sheets("Intro").ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(1).Values = Sheets("T_Monthly_Data").Range("E$8:BM$8")
The second range is blank so if checkbox is not selected it goes blank.
Now I would like the user to be able to select a start date and an end date and for the graphic to be able to automatically resize the x-axis and display only the data that relates to their query.
I would then like to repeat that so I can add additional series. Something like:
If Sheets("Intro").OLEObjects("Checkbox2").Object.Value = True Then
Charts("Chart1").SeriesCollection.Add _
Source:=ActiveWorkbook.Worksheets("T_Monthly_Data").Range("E$9:BM$9")
Any help would be appreciated!!
Thank you
Please excuse my VBA, it's terrible.
But I have a bar chart in Excel at the moment I have the following code to add a series:
If Sheets("Intro").OLEObjects("Checkbox1").Object.Value = True Then
Sheets("Intro").ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(1).Values = Sheets("T_Monthly_Data").Range("E$8:BM$8")
The second range is blank so if checkbox is not selected it goes blank.
Now I would like the user to be able to select a start date and an end date and for the graphic to be able to automatically resize the x-axis and display only the data that relates to their query.
I would then like to repeat that so I can add additional series. Something like:
If Sheets("Intro").OLEObjects("Checkbox2").Object.Value = True Then
Charts("Chart1").SeriesCollection.Add _
Source:=ActiveWorkbook.Worksheets("T_Monthly_Data").Range("E$9:BM$9")
Any help would be appreciated!!
Thank you