ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Problem formatting series in VBA (https://www.excelbanter.com/excel-programming/358810-problem-formatting-series-vba.html)

El_Pablo[_4_]

Problem formatting series in VBA
 

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


--
El_Pablo
------------------------------------------------------------------------
El_Pablo's Profile: http://www.excelforum.com/member.php...o&userid=33129
View this thread: http://www.excelforum.com/showthread...hreadid=532614



All times are GMT +1. The time now is 05:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com