This isn't a VBA question, exactly, but I have to start somewhere.
Perhaps somebody can point me in the right direction.
I want a line chart not to plot any cell with a zero value. Various
methods of not *displaying* zeroes don't affect what a chart plots--it
plots the invisible zero.
Here's an example:
I have a column E filled with the following formula (adjusted, of
course, to reflect the row number in which each cell appears):
=IF(OR(A2=0,B2=0),"",D2*1.5)
I add entries to the data daily. As I enter values in columns A and B
in its row, the E cell displays the calculated result; until then it
appears blank. A line chart embedded in the same worksheet shows the
continuing effect of each entry.
At any given time the series shown on the chart may be set to plot the
contents of cells $E$2:$E$80, and,for example, only rows 2:15 have
data in them. Cells E21:E80 will display blank, but on the chart the
corresponding plot line will plummet to the X axis and stay there. The
result is ugly and unprofessional-looking. The plot line should just
end where the data stops.
True, I can tell the chart not to plot *empty* cells, but the presence
of a formula seems to mean the cells are not empty. I guess I'm trying
to find a way to tell the chart to treat a cell with a zero value as
an empty cell, and I'm beginning to think it can't be done.
Note: in the example given above, if I delete the contents of E21,
including the formula, so it really is a blank cell, the chart will
plot neither it nor any of the following cells in the column, even
though they still have the formula in them. I suppose I could use some
kind of VBA macro to put the formula in the E-column cells *only* as I
enter data in the A and B columns, but this seems to be a very awkward
kludge.
Anybody got any ideas?