Problem formatting series in VBA

E

El_Pablo

Hi,

I've created a sub that creates a series on a chart. The problem is
that I have some problems formatting the series. Like changing color
or type of series.

Here's my sub:


Code:
--------------------


Sub DrawSeriesFromWorkBook(chrt As Chart, szName As String, Optional lColor As Long)

Dim sSeries As Series

Set sSeries = chrt.SeriesCollection.NewSeries
sSeries.ChartType = xlXYScatterLinesNoMarkers

If (IsMissing(lColor)) Then
sSeries.Border.Color = RGB(0, 0, 0)
Else
sSeries.Border.Color = lColor
End If

sSeries.Values = "='" & ThisWorkbook.Name & "'!" & szName

End Sub


--------------------


I think my sub is Ok in a programmaticaly way, but since it is VBA
:mad:

I would be happy, if someone can tell me what is wrong with this way to
format the series.

BTW: How do I count the number of point in ThisWorkBook.Names("ABC")??

Nick
 

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