Line colour of .SeriesCollection.NewSeries?

D

Dr.Ile

Help please!

I have a chart in which I want to import new series. They must be
inserted one by one, because I want to draw a discontinuous graph. And
here is my problem: when the data are inserted Excel automaticaly apply
different line colour for each new inserted line. How should I prevent
this. The code is dramaticaly slow down because of formating the lines

Here is the code in which I inserted new series and format each of them
in wanted style:

For L = 1 To j
Xkoordinate = Range(Cells(26 + L, 3), Cells(26 + L, 4))
Ykoordinate = Range(Cells(26 + L, 5), Cells(26 + L, 6))
Set aNewSeries = .SeriesCollection.NewSeries
aNewSeries.Values = Ykoordinate
aNewSeries.XValues = Xkoordinate
With .SeriesCollection(L)
..Border.Weight = xlThick 'Thin lines
..Border.ColorIndex = 25 'Blue lines
..MarkerStyle = xlNone 'Without markers
End With
Next L

Thank you in advance

Dr.Ile
 
J

Jim Cone

Is it a typo or does your code omit the leading dots...

.Border.Weight = xlThick 'Thin lines
.Border.ColorIndex = 25 'Blue lines
.MarkerStyle = xlNone 'Without markers


Jim Cone
San Francisco, USA


message
Help please!

I have a chart in which I want to import new series. They must be
inserted one by one, because I want to draw a discontinuous graph. And
here is my problem: when the data are inserted Excel automaticaly apply
different line colour for each new inserted line. How should I prevent
this. The code is dramaticaly slow down because of formating the lines

Here is the code in which I inserted new series and format each of them
in wanted style:

For L = 1 To j
Xkoordinate = Range(Cells(26 + L, 3), Cells(26 + L, 4))
Ykoordinate = Range(Cells(26 + L, 5), Cells(26 + L, 6))
Set aNewSeries = .SeriesCollection.NewSeries
aNewSeries.Values = Ykoordinate
aNewSeries.XValues = Xkoordinate
With .SeriesCollection(L)
Border.Weight = xlThick 'Thin lines
Border.ColorIndex = 25 'Blue lines
MarkerStyle = xlNone 'Without markers
End With
Next L

Thank you in advance

Dr.Ile
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top