Display a chart only if there is data
Hi Steve,
Good news!
Andy Pope has revised my code and fixed it up...
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Cht As ChartObject
Dim strSeries As String
Dim blnSeeChart As Boolean
On Error GoTo BLANK_CHART
For Each Cht In ActiveSheet.ChartObjects
blnSeeChart = True
strSeries = Cht.Chart.SeriesCollection(1).Formula
Cht.Visible = blnSeeChart
Next Cht
Exit Sub
BLANK_CHART:
blnSeeChart = False
Resume Next
End Sub
Next time you have a question about charts try
microsoft.public.excel.charting where charting genius Andy Pope will
find your solution in almost an instant.
Ken Johnson
|