Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 371
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 146
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 371
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ordering the chart by value Ruth Charts and Charting in Excel 0 May 27th 10 10:12 PM
Build too for ordering luckytr New Users to Excel 2 December 11th 08 06:14 PM
ordering pytelium Excel Discussion (Misc queries) 3 March 13th 06 11:21 PM
Ordering Patterns Tom Hewitt Excel Discussion (Misc queries) 0 September 20th 05 03:06 PM
ordering Dave B[_3_] Excel Programming 2 August 14th 04 03:52 AM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"