Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2004
    Posts
    2

    Unanswered: Working with Charts

    I have several questions regarding charts in Excell 03...
    I have 30+ charts that will be going into a report and I want to make them all consistent in several things: color, plot markers, size and font of legend, line weights, font sizes, plot area size, and just about everything else.

    I did start with one plot that had everything formated that way I wanted and then copyed it. I then changed the data series so each plot had the correct data shown. But in the process of working with the data, they got changed a little here and there.

    I actually have many questions but these two are the ones that I am having the most trouble with and I will post the rest as they come:

    1 - How do you, in VB, get a list of all of the charts on a sheet/workbook? I know there is a way to refer to a chart by index, but how do you know which chart is related to which index?

    2 - How do you get the name of the chart or is the only way to refer to one is by index?

    3 - How do you add/edit, via VB, what the data series are for a certain chart?



    Mucho gracis and Thanks a whole bunch

  2. #2
    Join Date
    Jan 2004
    Location
    Aberdeen, Scotland
    Posts
    1,067
    1 -

    Code:
    Sub test()
        For I = 1 To ChartObjects.Count
               Debug.Print ChartObjects(I).Name
               ChartObjects(I).DataSeries
        Next I
    End Sub
    the numbers of the charts go in order by which they were created

    2 - to reffer to a chart as a name
    ChartObjects("ChartName")

    3 -
    chartobjects(1).SetSourceData Source:=Worksheets("Worksheet Name").Range("Range"), PlotBy:=xlRows for example

    or for each series
    'make data range Black
    ActiveChart.SeriesCollection(1).Interior.ColorInde x = 1

    HTH
    Dave

  3. #3
    Join Date
    Sep 2004
    Posts
    2
    Thanks, will give those a whirl.

Posting Permissions

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