If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Working with Charts

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-05-04, 17:04
Temp123456789 Temp123456789 is offline
Registered User
 
Join Date: Sep 2004
Posts: 2
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
Reply With Quote
  #2 (permalink)  
Old 09-06-04, 08:31
DavidCoutts DavidCoutts is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 09-06-04, 13:53
Temp123456789 Temp123456789 is offline
Registered User
 
Join Date: Sep 2004
Posts: 2
Thanks, will give those a whirl.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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