Hi
I have a workbook which has 3 sheets;
sheet 1 holds the data,
sheet 2 has only one chart which is a smoothed line scatter chart based on the data in sheet 1, and
sheet 3 has three columns which specify RGB values, which I would like to apply to the lines between the the scatter points in sheet 2 so that Row 1's RGB values are used to colour the line between Points 1 and 2, row 2's between points 2 and 3....
I have used the following code to do something similar when the data, chart and colours were all on 1 sheet but am unable to find the syntax for specifying the sheets/chart.
I would like to be able to embed the code in a button on sheet 3 so on clicking it the colour formatting was applied and wonder if someone might oblige with some direction on working with multiple sheets.
Thanks
nicksoph
I have a workbook which has 3 sheets;
sheet 1 holds the data,
sheet 2 has only one chart which is a smoothed line scatter chart based on the data in sheet 1, and
sheet 3 has three columns which specify RGB values, which I would like to apply to the lines between the the scatter points in sheet 2 so that Row 1's RGB values are used to colour the line between Points 1 and 2, row 2's between points 2 and 3....
I have used the following code to do something similar when the data, chart and colours were all on 1 sheet but am unable to find the syntax for specifying the sheets/chart.
I would like to be able to embed the code in a button on sheet 3 so on clicking it the colour formatting was applied and wonder if someone might oblige with some direction on working with multiple sheets.
Thanks
nicksoph
Code:
Sub colplot()
Dim i As Double, plotcounter As Double
plotcounter = 1 ' The number of the series to plot
'
For i = 1 To 20 ' first 20 rows in sheet
ActiveChart.SeriesCollection(plotcounter).Points(i).Border.Color = RGB(Cells(i, 3), Cells(i, 4), Cells(i, 5))
Next i
End Sub