Hi Geoff -
This assumes the charts are made in a particular order, etc., etc. It also doesn't
stop at 4 charts, it will do all that you have on the initial sheet. Change the
workbook and sheet references for your particular situation.
Sub MoveLinearChartsToArray()
Dim wsSource As Worksheet
Dim wsTarget As Worksheet
Dim i As Integer
Set wsSource = Workbooks("Book4").Worksheets(1)
Set wsTarget = Workbooks("Book5").Worksheets(1)
For i = 1 To wsSource.ChartObjects.Count
wsSource.ChartObjects(i).Copy
wsTarget.Paste
With wsTarget.ChartObjects(i)
.Left = .Width * ((i - 1) Mod 2)
.Top = Int((i - 1) / 2) * .Height
End With
Next
End Sub
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
Geoff wrote:
'Unable I have 4 graphs in a row under some data, which are generated into
excel format from a database.
I need to place these 4 graphs onto another workbook, in a particular
configuration, eg, instead of being in a row, I now want them 2x2.
I am having no luck in recording a macro.
I would be grateful for any suggestions how to achieve this.
I use Excel 2002.
Many thanks,
Geoff.