• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

make a button for a printpreview of a graph (graph on a page)

Jurgen Smits

New Member
Hello,

I'm stuck with a problem. I hope someone can help me. I want make a printpreview of graph what is a page (not a object). I think I made a simple error, but I'm stuck.
And I can't save the macro to the file

This is the code I used

Sub printscreenPMR()
Range("PMR").PrintPreview
End Sub

Thanks for helping
 

Attachments

  • test vba2.xlsm
    17 KB · Views: 2
Try this idea instead
Code:
Sub printcharts()
Dim Ch As ChartObject
For Each Ch In ActiveSheet.ChartObjects
Ch.Chart.PrintPreview
Next
End Sub

Or you can use something like the code below with slight mod:
Code:
Sub PrintAllCharts()
Dim c As Object, w As Worksheet
For Each w In ActiveWorkbook.Worksheets
For Each c In w.ChartObjects
c.Chart.PrintOut
Next c
Next w
End Sub
 
Last edited by a moderator:
Back
Top