I am trying to create a dynamic graph where the user can select which series they want to be plotted for the primary and secondary axis (line graph), and what they want the X-axis to be. I am importing data from another source (that code is finished) and have a sheet with a variable number of columns depending on what was imported. I want a checkbox for primary and secondary y-axis series, and a drop-down menu for what the X-axis is.

The method I use right now is to create a second table of data that the graph comes from and create a checkbox based on turning those columns from values to NA()...when I do that it includes all of the series (anywhere from 5-15) on my legend though and I would really like to just include what I am graphing in the legend. I can only figure this out for the primary axis and don't know how to do the secondary axis (there may not always be one).


I can attach a sample worksheet if that would help, but it will basically be a blank graph and big data table.

Things I can't figure out:
-Selecting the x-axis from a drop-down
-Selecting which series to include on a secondary axis
-How to select the series without including every possible series in the legend


Any suggestions or help would be appreciated!