Dynamically Hiding Empty Series with VBA?

  • Thread starter Thread starter bill..
  • Start date Start date
B

bill..

My application generates a chart using VBA that defines the various
column ranges and uses Union to sum them for .SetSourceData

Sometimes a aparticular series has no valid data - but always has a
header.

How can I prevent that series from showing up in the chart AND its
header showing up in the legend?


One idea was to hide the EntireColumn after the chart is built but I
cannot seem to find a way of determining whether a column range is
empty of numeric data since they all have a header.


Any ideas how to tackle this?

Thanks

Bill
 
If you want to check if a particular column has only a header and no
other data, use application.worksheetfunction.CountA(range("a:a"))=1
where a:a represents column A.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
 
Back
Top