Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

print excel charts from macro 1

Status
Not open for further replies.

elohelae

Technical User
Feb 25, 2011
27
GB
Hello

I have an excel dashboard with 10 charts on it and I have now been asked to place a button on the chart which when clicked will print out all the charts on individual sheets.

What is the best method to go about this? Any good advice would be appreciated.
 
I found this code and it works great

dim ws as worksheet, co as chartobject

For Each ws In ActiveWorkbook.worksheets
For Each co in ws.chartobjects
co.chart.printout
next co
next ws

however I have now been asked to print them landscape and also now can they have 2 charts per page, how would i go about that?

either or both solutions would be great :)

thanks
 



I am confused! The code that you posted prints each chart alone. Does your setup not default to landscape for each chart?

If you want 2 charts per page, I'd suggest using the Camera Tool to position dynamic 'pictures' of your charts on a separate sheet for printing, in the way you want them displayed.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Skip

Thank you for the advice

in response, the code prints out exactly what i need except it does it in portrait instead of landscape.

so i just changed the chart type individually and it works now.

thanks for your assistance, your code was helpful.
 

so i just changed the chart type individually
This is what recording a macro is for. You could have recorded a macro for changing the print orientation of the chart and used it in your code.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top