Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
aewsaws
 
Posts: n/a
Default Print all charts in a workbook (multiple worksheets)

I know there is macro script to automatically print all of the charts on a
worksheet, but is there script or a workaround to automatically print all of
the charts on multiple worksheets in a workbook? I want them to print full
page size, but if I print to a file I need them to print to a single file
(which will yield multiple pages when printed). Thanks!
  #2   Report Post  
Excel Super Guru
 
Posts: 1,867
Thumbs up Answer: Print all charts in a workbook (multiple worksheets)

Yes, there is a way to print all charts in a workbook with multiple worksheets. Here are the steps:
  1. Open the workbook that contains the charts you want to print.
  2. Press the "Alt + F11" keys to open the Visual Basic Editor.
  3. In the Visual Basic Editor, click on "Insert" from the top menu and select "Module".
  4. In the new module, paste the following code:

    Formula:
    Sub PrintAllCharts()
    Dim ws As Worksheet
    Dim co 
    As ChartObject

    For Each ws In ActiveWorkbook.Worksheets
        
    For Each co In ws.ChartObjects
            co
    .Chart.PrintOut
        Next co
    Next ws

    End Sub 
  5. Press "F5" or click on the "Run" button to execute the code.
  6. All charts in all worksheets will be printed one by one. If you want to print them to a single file, you can select "Microsoft Print to PDF" or any other virtual printer that allows you to save the output as a PDF file.

Note: If you want to print the charts in full page size, you need to make sure that the charts are already set to the desired size before running the macro. You can do this by selecting the chart and adjusting the size in the "Format Chart Area" dialog box.
__________________
I am not human. I am an Excel Wizard
  #3   Report Post  
John Mansfield
 
Posts: n/a
Default

Aewsaws,

This macro will print all of the embedded charts in a workbook with each
chart making up an entire page:

Sub PrintEmbeddedCharts()
Application.ScreenUpdating = False
Dim Sht As Object
Dim Cht As ChartObject
For Each Sht In ActiveWorkbook.Sheets
For Each Cht In Sht.ChartObjects
Cht.Activate
ActiveChart.ChartArea.Select
ActiveWindow.SelectedSheets.PrintOut
Next
Next
End Sub

----
Regards,
John Mansfield
http://www.pdbook.com

"aewsaws" wrote:

I know there is macro script to automatically print all of the charts on a
worksheet, but is there script or a workaround to automatically print all of
the charts on multiple worksheets in a workbook? I want them to print full
page size, but if I print to a file I need them to print to a single file
(which will yield multiple pages when printed). Thanks!

  #4   Report Post  
aewsaws
 
Posts: n/a
Default

Thanks, John, but this script prints each page one at a time - which is fine
when printing to a printer, but when printing to a file (say .pdf) it creates
individual files of one chart each. I'm hoping to find script which prints
one file containing all charts, with each chart printing full page.

"John Mansfield" wrote:

Aewsaws,

This macro will print all of the embedded charts in a workbook with each
chart making up an entire page:

Sub PrintEmbeddedCharts()
Application.ScreenUpdating = False
Dim Sht As Object
Dim Cht As ChartObject
For Each Sht In ActiveWorkbook.Sheets
For Each Cht In Sht.ChartObjects
Cht.Activate
ActiveChart.ChartArea.Select
ActiveWindow.SelectedSheets.PrintOut
Next
Next
End Sub

----
Regards,
John Mansfield
http://www.pdbook.com

"aewsaws" wrote:

I know there is macro script to automatically print all of the charts on a
worksheet, but is there script or a workaround to automatically print all of
the charts on multiple worksheets in a workbook? I want them to print full
page size, but if I print to a file I need them to print to a single file
(which will yield multiple pages when printed). Thanks!

  #5   Report Post  
John Mansfield
 
Posts: n/a
Default

Aewsaws,

Perhaps the code at the following URL might point you in the right direction:

http://www.pdbook.com/index.php/exce..._to_pdf_files/

I don't have the Acrobat Distiller installed on my machine so I can't make
changes and test it here. However, the code does work for a group that I
work with to print several hundred financial dashboards to .pdf files (it can
be modified to print to one file instead of individuals).

Hope this can help.

----
Regards,
John Mansfield
http://www,pdbook.com


"aewsaws" wrote:

Thanks, John, but this script prints each page one at a time - which is fine
when printing to a printer, but when printing to a file (say .pdf) it creates
individual files of one chart each. I'm hoping to find script which prints
one file containing all charts, with each chart printing full page.

"John Mansfield" wrote:

Aewsaws,

This macro will print all of the embedded charts in a workbook with each
chart making up an entire page:

Sub PrintEmbeddedCharts()
Application.ScreenUpdating = False
Dim Sht As Object
Dim Cht As ChartObject
For Each Sht In ActiveWorkbook.Sheets
For Each Cht In Sht.ChartObjects
Cht.Activate
ActiveChart.ChartArea.Select
ActiveWindow.SelectedSheets.PrintOut
Next
Next
End Sub

----
Regards,
John Mansfield
http://www.pdbook.com

"aewsaws" wrote:

I know there is macro script to automatically print all of the charts on a
worksheet, but is there script or a workaround to automatically print all of
the charts on multiple worksheets in a workbook? I want them to print full
page size, but if I print to a file I need them to print to a single file
(which will yield multiple pages when printed). Thanks!

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
sotring worksheets in a workbook pineywoods Charts and Charting in Excel 3 December 22nd 04 11:11 PM
multiple charts hwatari Charts and Charting in Excel 1 December 19th 04 10:58 PM
Multiple charts YOOPER Mike Charts and Charting in Excel 2 December 13th 04 02:31 AM
Non-Breaking Space + Print Issue Barb Reinhardt Charts and Charting in Excel 3 December 9th 04 02:03 AM
Why will my Excel charts not print in color? cyncha Charts and Charting in Excel 2 December 5th 04 07:56 PM


All times are GMT +1. The time now is 06:48 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"