ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy and paste a chart to another worksheet (https://www.excelbanter.com/excel-programming/297920-copy-paste-chart-another-worksheet.html)

Flystar[_5_]

Copy and paste a chart to another worksheet
 
How do I copy a chart *exactly* as it is (same fonts, colors, dat
range, titles etc) to another worksheet in another workbook. I ca
easily enough open a workbook and a particular worksheet, but when
copy and paste the chart the axes font size changes.

'The following is the code I use to copy the active chart to anothe
workbook, and paste it at position A3
ActiveSheet.ChartObjects(1).Activate 'Chart to copy
ActiveChart.ChartArea.Select
ActiveChart.ChartArea.Copy
Workbooks("ChartBook.xls").Worksheets("A").Paste
Workbooks("ChartBook.xls").Worksheets("A").ChartOb jects(1).Left
Workbooks("ChartBook.xls").Worksheets("A").Range(" A3").Left
Workbooks("ChartBook.xls").Worksheets("A").ChartOb jects(1).Top
Workbooks("ChartBook.xls").Worksheets("A").Range(" A3").Top
ActiveSheet.Activat

--
Message posted from http://www.ExcelForum.com


anurag.d[_7_]

Copy and paste a chart to another worksheet
 
Hi
Right click your sheet containing the chart.
Click the move command.
Select the workbook u want to move your chart to and move it

--
Message posted from http://www.ExcelForum.com


Flystar[_6_]

Copy and paste a chart to another worksheet
 
Thanks for your help anurag.d.

I actually want to copy and paste the chart using a vba macro (as th
code I attached suggests). I generate a chart in one worksheet, forma
the axes, colors etc and then want to copy this active chart to anothe
worksheet in a different workbook. I have tried copying and pasting th
chart to the same worksheet, and here the fonts change also.

Is this the correct method for copying the chart in the first place, o
is there a better way?

ACTIVECHART.CHARTAREA.SELEC
*ActiveChart.ChartArea.Copy*

Is this the correct way to paste the chart?

*Workbooks("ChartBook.xls").Worksheets("A").Paste

--
Message posted from http://www.ExcelForum.com


Flystar[_7_]

Copy and paste a chart to another worksheet
 
I suppose I could place all of the formating code I perform for the
original chart (the one I want to copy) into a function, and then call
this function again for the chart I paste into the other worksheet.
However, to do this I would like to pass the chart object as a
parameter. How could I do this? Or should I just set the chart to
format as activechart, format, and then activate the original worksheet
again.

It would be fantastic if someone could help me out with this one.


---
Message posted from http://www.ExcelForum.com/


Flystar[_8_]

Copy and paste a chart to another worksheet
 
Is there a way to copy the chartobject and paste the object, rather the
copying and pasting the chartarea

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 08:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com