Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Ordering graphs
'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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Ordering graphs
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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Ordering graphs
Thanks Jon, Exactly what I needed ! Will really help speed things along,
since this process needs to be done many times over. Thanks again. Geoff. "Jon Peltier" wrote: 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Ordering the chart by value | Charts and Charting in Excel | |||
Build too for ordering | New Users to Excel | |||
ordering | Excel Discussion (Misc queries) | |||
Ordering Patterns | Excel Discussion (Misc queries) | |||
ordering | Excel Programming |