Copy and paste a chart to another worksheet

  • Thread starter Thread starter Flystar
  • Start date Start date
F

Flystar

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").ChartObjects(1).Left
Workbooks("ChartBook.xls").Worksheets("A").Range("A3").Left
Workbooks("ChartBook.xls").Worksheets("A").ChartObjects(1).Top
Workbooks("ChartBook.xls").Worksheets("A").Range("A3").Top
ActiveSheet.Activat
 
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
 
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
 
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.
 
Is there a way to copy the chartobject and paste the object, rather the
copying and pasting the chartarea
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top