|
- Sub test()
- Dim cht As Chart
- Dim ser As Series
- Set cht = ActiveSheet.ChartObjects(1).Chart
- Set ser = cht.SeriesCollection(1)
- ActiveSheet.ChartObjects(1).Activate
- For j = 1 To ser.Points.Count
- ActiveChart.FullSeriesCollection(1).Points(j).Select
- If ser.Values(j) <= 30 Then
- ActiveChart.FullSeriesCollection(1).Points(j).Format.Fill.ForeColor.RGB = RGB(192, 0, 0)
- ElseIf ser.Values(j) <= 60 Then
- ActiveChart.FullSeriesCollection(1).Points(j).Format.Fill.ForeColor.RGB = RGB(255, 255, 0)
- ElseIf ser.Values(j) <= 90 Then
- ActiveChart.FullSeriesCollection(1).Points(j).Format.Fill.ForeColor.RGB = RGB(0, 176, 80)
- Else
- ActiveChart.FullSeriesCollection(1).Points(j).Format.Fill.ForeColor.RGB = RGB(0, 176, 240)
- End If
- Next j
- End Sub
复制代码
|
|