+ Reply to Thread
Results 1 to 3 of 3

Multiple chart copy

  1. #1
    MarkyP
    Guest

    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. #2
    Dave Peterson
    Guest

    Re: Multiple chart copy

    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. #3
    MarkyP
    Guest

    Re: Multiple chart copy

    Thanks Dave
    I'll give that a go.

    Mark



    Dave Peterson <ec35720@netscapeXSPAM.com> wrote in message news:<42308F66.590AF902@netscapeXSPAM.com>...
    > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1