I have a bar chart in Excel (2016) which derives its data from various places in a complicated spread sheet by the user selecting certain variables to show using a user form. If a set of data is shown or not is automated in excel by either collecting values, or setting all the values to 0.
Also when a set of data is populated (and therefore shown) the legend entry is formatted by the text build up routine.
and when I want that series not to be shown this runs
the problem I have is that I want to insert the code into the routine to show or hide the specific legend entry for that particular series, but I cannot figure out how to do it. I suspect it has something to do with LegendEntry but am struggling. currently they are invisible so think I may have inadvertently deleted them (individually) as the master series remains, but am not finding a route through this one.
I have also discovered that somehow in my code I have several index numbers for the same series, While this is not spoiling the running of the routine, I am confused why this is happening.
Any input at all would be greatly appreciated
S
Also when a set of data is populated (and therefore shown) the legend entry is formatted by the text build up routine.
Code:
Sub RanPop2()
ReDim POSarray(1 To DDepth)
' Debug.Print RanDate
With Worksheets("RunningTotals")
LastCol = .Cells(1, .Columns.Count).End(xlToLeft).Column
End With
With Worksheets("RunningTotals")
With .Range(.Range("A1"), .Range("A1").Offset(0, LastCol))
Set RanCol = .Find(What:=RanDate, LookAt:=xlWhole, MatchCase:=False, SearchFormat:=False)
If Not RanCol Is Nothing Then
' Debug.Print rFind.Column
For I = 1 To DDepth
POSarray(I) = Worksheets("RunningTotals").Range("a2").Offset((YearOff + I), RanCol.Column)
Next I
Sheets("ChartByCount").FullSeriesCollection(1).Values = POSarray
Sheets("ChartByCount").FullSeriesCollection(1).Name = Format(RanDate, "mmm-yy")
End If
End With
End With
End Sub
Code:
Sub RanClr2()
ReDim POSarray(1 To 1)
Sheets("ChartByCount").FullSeriesCollection(1).Values = POSarray
Sheets("ChartByCount").FullSeriesCollection(1).Name = "=""Undefined"""
End Sub
I have also discovered that somehow in my code I have several index numbers for the same series, While this is not spoiling the running of the routine, I am confused why this is happening.
Any input at all would be greatly appreciated
S