Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.charting
|
|||
|
|||
![]()
I have a little problem with some code I've been using. In my workbook I have
7 sheets with 45+ pre-made charts. Some have data but most don't. The current code I have counts how many charts there are on the sheet, selects, activates, and prints them all the way I like. Thing is I'd like it to print only the charts with data in them. I thought that a code could be made that checks the source range of the chart for numbers then prints that chart. However because there are 45+ charts and 7 sheets that would take awhile. Below is an example of the code i'm currently using. Sub PrintEmbeddedCharts() Dim ChartList As Integer Dim X As Integer ' Variable chartlist stores a count of all embedded charts. ChartList = ActiveSheet.ChartObjects.Count ' Increments the counter variable 'X' in a loop. For X = 1 To ChartList ' Selects the chart object. ActiveSheet.ChartObjects(X).Select ' Makes chart active. ActiveSheet.ChartObjects(X).Activate ' Prints one copy of active chart. ActiveChart.PrintOut Copies:=1 Next End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Always print to a specific location | Excel Discussion (Misc queries) | |||
How To always print to a specific Location | Excel Discussion (Misc queries) | |||
Don't print a specific cell | Excel Worksheet Functions | |||
print specific cells | Excel Discussion (Misc queries) | |||
print a specific area within a worksheet by clicking on print? | Excel Worksheet Functions |