I'm trying to have a graph that doesn't chart 0 values. I'm using an array so I can change the value if it equals zero but I don't know what to change it to to make the chart not automatically graph it. Any help is appreciated.
This is my code that creates the array, assigns the series to it, and changes the values. Null still operates as zero which is kinda expected but unfortunate.
Dim ColumnData As Variant, c As Chart, s As Series, g As Integer
ReDim ColumnData(EndNumber - StartNumber)
g = 1
Set c = ActiveChart
'ReDim ColumnData(EndNumber - StartNumber)
'ColumnData = Range(Cells(StartNumber, 20), Cells(EndNumber, 29)).Value
For i = 20 To 28
Set s = c.FullSeriesCollection(g)
ColumnData = Range(Cells(StartNumber, i), Cells(EndNumber, i))
'MsgBox LBound(ColumnData)
For j = LBound(ColumnData, 1) To UBound(ColumnData, 1)
If ColumnData(j, 1) = 0 Then
ColumnData(j, 1) = Null
End If
Next j
s.Values = ColumnData
g = g + 1
Next i
This is my code that creates the array, assigns the series to it, and changes the values. Null still operates as zero which is kinda expected but unfortunate.
Dim ColumnData As Variant, c As Chart, s As Series, g As Integer
ReDim ColumnData(EndNumber - StartNumber)
g = 1
Set c = ActiveChart
'ReDim ColumnData(EndNumber - StartNumber)
'ColumnData = Range(Cells(StartNumber, 20), Cells(EndNumber, 29)).Value
For i = 20 To 28
Set s = c.FullSeriesCollection(g)
ColumnData = Range(Cells(StartNumber, i), Cells(EndNumber, i))
'MsgBox LBound(ColumnData)
For j = LBound(ColumnData, 1) To UBound(ColumnData, 1)
If ColumnData(j, 1) = 0 Then
ColumnData(j, 1) = Null
End If
Next j
s.Values = ColumnData
g = g + 1
Next i