+ Reply to Thread
Results 1 to 2 of 2

Create Multiple Charts w/ VB

  1. #1
    quickcreator
    Guest

    Create Multiple Charts w/ VB


    I'd like to create a chart, many times over.
    My data is in XY format.

    Upon using the recording feature, it locks in a specific chart name,
    "Chart1"; and also, locks in a specific data range, "A1:F5".

    I was wanting to create this XY chart with A1:F5 for Chart1, then have
    it move down and grab A7:F11 for Chart2, and so on. I have about 100
    or so data ranges to create that many charts.

    How can I make these references relative or unlock the specific cell
    address?

    Any help would be greatly appreciated.

    Thanks!,
    Kevin


    --
    quickcreator

  2. #2
    Jon Peltier
    Guest

    Re: Create Multiple Charts w/ VB

    Kevin -

    You'll need something like this:

    Sub MakeCharts()
    Dim iChart as Long
    Dim wsData as Worksheet

    Set wsData = ActiveSheet
    For iChart = 1 to 100
    With Charts.Add
    .SetSourceData _
    Source:=wsData.Range("A1:F5").Offset((iChart - 1) * 6)
    .Name = "Chart" & Format(iChart, "000")
    End With
    Next
    End Sub

    - Jon
    -------
    Jon Peltier, Microsoft Excel MVP
    Peltier Technical Services
    Tutorials and Custom Solutions
    http://PeltierTech.com/
    _______

    quickcreator wrote:

    > I'd like to create a chart, many times over.
    > My data is in XY format.
    >
    > Upon using the recording feature, it locks in a specific chart name,
    > "Chart1"; and also, locks in a specific data range, "A1:F5".
    >
    > I was wanting to create this XY chart with A1:F5 for Chart1, then have
    > it move down and grab A7:F11 for Chart2, and so on. I have about 100
    > or so data ranges to create that many charts.
    >
    > How can I make these references relative or unlock the specific cell
    > address?
    >
    > Any help would be greatly appreciated.
    >
    > Thanks!,
    > Kevin
    >
    >



+ 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