Hi - this post is not as long as it seems, I've included some code for reference so please keep reading 
I have a bunch of data sheets that are identical in format (other than the number of rows). I'm trying to make a bunch of different graphs for the data sheet (same graphs for each worksheet). In order to make comparing data series easier, I'm trying to have a list of check boxes representing all of my different worksheets, and through these checkboxes, be able to select which of these data series I want to plot on the same graph.
To keep things simple, I've just been trying to work with two worksheets and one graph.
This is the code for my first checkbox (which works okay on it's own):
My second checkbox is the one giving me problems...I think I've done a few things wrong here, but I'm a complete rookie and am not sure how to go about fixing them.
- For starters, I get a subscript out of range error for the line Charts("Chart1").Activate
- I don't know how to set up my code so that if FB1 data is not selected, I still create a plot (without creating two plots by adding a chart in the checkbox 2 code)
- Another thing that is kind of annoying is that the second i select the checkbox for my first data sheet, excel graphs it and jumps to the "plots" worksheet so i have to go back to my grapher sheet to select another series to graph...should i just activate the graphical control sheet at the end of my code? it would be better if i could implement a command button that is linked to the selection of check boxes so that the selection boxes don't execute an action the second they're clicked
- is it possible to have a "select" function with different cases for all my checkboxes rather than having a different sub for each? I think this would be best, then I could maybe create the shell for a graph before selecting which data series to plot...
I'll post updates as I change things around. If someone could just point me in the right direction as to how to structure this sort of idea that would be great. I have some coding experience, just not with VBA.
Thanks in advance,
Dan
Bookmarks