Yes, to my knowledge there's no such thing as the 'visible' property of a series.
But I needed to be able to quickly hide/show series on a chart sheet and did not want to futz with hiding columns etc (vba too involved, didn't want to have to create a form, multiple workbooks involved, etc.) so I came up with the following system of subs.
sub ToggleVisibleSeries builds the inputbox where one toggles the parameters for an individual series to show (1) or be hidden (0). At first the input box can look daunting but it is a quick way of providing an interface to the 'visible' parameter of the series
sub DefineSeriesCollection creates a "local" index for each series by assigning each successive series a factor of ten higher index (i.e. Series 1 gets local index 1, Series 2 gets local index 10, Series 3 gets local index 100 and so on) and then adds these to form a global index for all series which could look like 111111 if you have 6 series. This concatenated local index is the default input for the inputbox
Note: I defined a redim of the vSeriesVisibleFlagCollection array contained in this sub with the workbook_open event as follows
sub ToggleSeriesYValues kicks off the toggling of the Y values for a series to 0 to hide it or to its original values to show it by using the replace function to modify the series formula
sub ToggleSeriesVisibleFlag actually does the toggling of the 'visible' flag
Below is the code (which when run will hopefully be better explain itself than this text). Just paste this to a module and fire off ToggleVisibleSeries and change the inputs from 1 to 0 and back to watch your series show or be hidden
HERE'S THE QUO: can you tell me how to make the four subs better?
Thanks All!
Bookmarks