Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data showing incorrectly on line chart gobonniego Charts and Charting in Excel 1 June 15th 06 07:56 PM
ranking query JaimeTimbrell Excel Discussion (Misc queries) 2 February 16th 06 08:09 AM
Why doesn't my chart update when underlying data changes? Marc Charts and Charting in Excel 3 November 19th 05 05:31 PM
Activating a Chart object Hari Prasadh Charts and Charting in Excel 6 August 2nd 05 07:22 PM
Extending a Chart Data Series from an Array - Can it be done? Jon Peltier Charts and Charting in Excel 4 November 30th 04 03:30 AM


All times are GMT +1. The time now is 05:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"