Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
No chart if there is no data
Hi,
I have an spreadsheet template that is being used to create multiple reports. This template has multiple charts. In some of the reports there is no data to feed the report, but it still shows the chart (empty of course). I would like for this not to show if there is no data. there are over a houndred reports that are being generated which is why it is very tedious to remove each empty chart by hand. I have tried some VBA scripts but was not successfull. I have found a similar topic in this newsgroup but the solution did not work for me. Any suggestions?? Here is a link to that topic http://groups.google.nl/group/micros...2207df658410f0 Here is the code 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Data showing incorrectly on line chart | Charts and Charting in Excel | |||
ranking query | Excel Discussion (Misc queries) | |||
Why doesn't my chart update when underlying data changes? | Charts and Charting in Excel | |||
Activating a Chart object | Charts and Charting in Excel | |||
Extending a Chart Data Series from an Array - Can it be done? | Charts and Charting in Excel |