largeselection
Active Member
- Joined
- Aug 4, 2008
- Messages
- 358
Hi,
I'm trying to color some datapoints in a scatterplot based on the color in the neighboring cell where the data is. I've written some code, but I'm not sure why it's not working. I don't get any errors, but the datapoints do not change color. Basically I recorded myself selecting a datapoint and then altered what was recorded to apply to all the points.
The reason why I have the Points(Range(Range... part is because the first row of data corresponds to Points(1) as I found out by recording. The second row of data corresponds to Points(2), etc. So since I am starting at the first row of data I want the Point to be edited to be the one equal to the count of rows until that row.
Any help is much appreciated
I'm trying to color some datapoints in a scatterplot based on the color in the neighboring cell where the data is. I've written some code, but I'm not sure why it's not working. I don't get any errors, but the datapoints do not change color. Basically I recorded myself selecting a datapoint and then altered what was recorded to apply to all the points.
Code:
Range("F28").Select
Dim rng As Range
Set rng = Range("M5:M15")
Do Until IsEmpty(ActiveCell)
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(1).Select
ActiveChart.SeriesCollection(1).Points(Range(Range("F28"), ActiveCell).Rows.Count).Select
With Selection.Format.Fill
.Visible = msoTrue
.ForeColor.RGB = Range("M4").Offset(Application.Match(ActiveCell.Offset(0, 1).Value, rng, 0), 0).Interior.Color
.Transparency = 0.5
End With
ActiveCell.Offset(1, 0).Select
The reason why I have the Points(Range(Range... part is because the first row of data corresponds to Points(1) as I found out by recording. The second row of data corresponds to Points(2), etc. So since I am starting at the first row of data I want the Point to be edited to be the one equal to the count of rows until that row.
Any help is much appreciated