#1   Report Post  
MarkyP
 
Posts: n/a
Default Multiple chart copy

Hi there,

Is there any way that i can copy a user defined number of charts on a
sheet.
There are 24 charts on the sheet and i want to copy a predefined
number of these (for pasting into WORD).
when using.....

ActiveSheet.Shapes.Range(Array("Chart 84", "Chart 85", "Chart
86")).Select

the charts have to be indentified before runtime.

is there a way such as

For a = ChartNumFirst to ChartNumLast
chartobjects(a).copy
next

so i end up with all charts copied, rather than just the last one?


regards,

Mark
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

Option Explicit
Sub testme()

Dim myChartNames() As String
Dim a As Long
Dim ChartNumFirst As Long
Dim ChartNumLast As Long

ChartNumFirst = 1
ChartNumLast = 2
'...
ReDim myChartNames(ChartNumFirst To ChartNumLast)

For a = ChartNumFirst To ChartNumLast
myChartNames(a) = ActiveSheet.ChartObjects(a).Name
Next a

ActiveSheet.ChartObjects(myChartNames).Select

End Sub


MarkyP wrote:

Hi there,

Is there any way that i can copy a user defined number of charts on a
sheet.
There are 24 charts on the sheet and i want to copy a predefined
number of these (for pasting into WORD).
when using.....

ActiveSheet.Shapes.Range(Array("Chart 84", "Chart 85", "Chart
86")).Select

the charts have to be indentified before runtime.

is there a way such as

For a = ChartNumFirst to ChartNumLast
chartobjects(a).copy
next

so i end up with all charts copied, rather than just the last one?

regards,

Mark


--

Dave Peterson
  #3   Report Post  
MarkyP
 
Posts: n/a
Default

Thanks Dave
I'll give that a go.

Mark



Dave Peterson wrote in message ...
Option Explicit
Sub testme()

Dim myChartNames() As String
Dim a As Long
Dim ChartNumFirst As Long
Dim ChartNumLast As Long

ChartNumFirst = 1
ChartNumLast = 2
'...
ReDim myChartNames(ChartNumFirst To ChartNumLast)

For a = ChartNumFirst To ChartNumLast
myChartNames(a) = ActiveSheet.ChartObjects(a).Name
Next a

ActiveSheet.ChartObjects(myChartNames).Select

End Sub


MarkyP wrote:

Hi there,

Is there any way that i can copy a user defined number of charts on a
sheet.
There are 24 charts on the sheet and i want to copy a predefined
number of these (for pasting into WORD).
when using.....

ActiveSheet.Shapes.Range(Array("Chart 84", "Chart 85", "Chart
86")).Select

the charts have to be indentified before runtime.

is there a way such as

For a = ChartNumFirst to ChartNumLast
chartobjects(a).copy
next

so i end up with all charts copied, rather than just the last one?

regards,

Mark

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
How can I display multiple series in a pie chart? AncientPC Charts and Charting in Excel 3 May 3rd 23 05:09 PM
CREATE MACRO TO COPY MULTIPLE WORKSHEETS Bewilderd jim Excel Discussion (Misc queries) 5 March 3rd 05 10:00 PM
Copy multiple charts from Excel to Power Point Genef Charts and Charting in Excel 1 March 2nd 05 01:25 AM
Problem with xlusrgal.xls file Alfred S C Lee Charts and Charting in Excel 2 December 29th 04 05:54 PM
copy pivot table to multiple worksheets Todd Excel Worksheet Functions 2 November 19th 04 03:16 AM


All times are GMT +1. The time now is 06:05 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"