I am creating various charts from the same source. I would like to be able to cut paste with vba each chart as a picture. Does anyone know the right code?
I tried with this but it does not work:
Range("B21:C22").Select
ActiveSheet.Shapes.AddChart.Select
ActiveChart.SetSourceData Source:=Range("'Graphs'!$B$21:$C$22")
ActiveChart.ChartType = xl3DPie
ActiveChart.ChartArea.Select
ActiveChart.ChartArea.Copy
ActiveSheet.Pictures.Paste.Select
I always find copying charts confusing, but this does what you want, I think, and doesn't use any
Selects
, which is always nice.