Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Interior color

Thanks, it work brilliant. I have been struggle a lot to find the right
syntax and I see now that I was close.

Cheers
Paal

"Paal" wrote:

Hi, I have the following code which generate a chart with three series. I'm
struggling with solving how I can set the color of the different series. So
any suggestion.

Sub addchart()
With ActiveSheet
Set objChart = .ChartObjects.Add(Left:=1, Width:=720, Top:=1,
Height:=425)
objChart.Chart.ChartType = xlXYScatterSmoothNoMarkers
PT001 = FinnSlutt("M")
Xrange = "=Data!R12C13:R" & PT001 & "C13"
Yrange = "=Data!R12C14:R" & PT001 & "C14"
Result = NySerie(objChart, Xrange, Yrange, "=Data!R11C14", 1)
PT002 = FinnSlutt("R")
Xrange = "=Data!R12C18:R" & PT002 & "C18"
Yrange = "=Data!R12C19:R" & PT002 & "C19"
Result = NySerie(objChart, Xrange, Yrange, "=Data!R11C19", 2)
If (Worksheets("Data").Range("AB12").Value < "") Then
TT001 = FinnSlutt("W")
Xrange = "=Data!R12C23:R" & TT001 & "C23"
Yrange = "=Data!R12C24:R" & TT001 & "C24"
Result = NySerie(objChart, Xrange, Yrange, "=Data!R11C24", 3)
End If
With objChart.Chart
.PlotArea.Interior.ColorIndex = xlNone
.Refresh
.Axes.MinimumScale = 0
.ax .MaximumScale = 370
End With
end sub
Function NySerie(objChart, Xvalues, Yvalues, Name, x)
objChart.Chart.SeriesCollection.NewSeries
objChart.Chart.SeriesCollection(x).Xvalues = Xvalues
objChart.Chart.SeriesCollection(x).Values = Yvalues
objChart.Chart.SeriesCollection(x).Name = Name
End Function

I have tried with this but get only error.
objChart.Chart.SeriesCollection(1).Interior.ColorI ndex = 5

Thanks
Paal


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Interior Color Macro Phil H[_2_] Excel Programming 4 March 10th 06 10:29 AM
Sum all cells with interior color... Ctech[_65_] Excel Programming 4 January 11th 06 07:46 PM
Passing Back Color to Interior Color ExcelMonkey[_190_] Excel Programming 1 March 22nd 05 04:27 PM
Interior Cell color Pellechi Excel Programming 1 September 23rd 03 03:39 PM


All times are GMT +1. The time now is 05:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"