Set CRange = Range(ActiveSheet.Cells(22, ICol), ActiveSheet.Cells(22, JCol))
i = 1
ActiveSheet.ChartObjects(2).Activate
With ActiveChart.SeriesCollection(1)
For Each CEL In CRange 'Range("b22:bc22")
Select Case CEL.Value
Case Is < 0.9
.Points(i).Interior.ColorIndex = 4
Case 0.9 To 1.05
.Points(i).Interior.ColorIndex = 27
Case Is > 1.05
.Points(i).Interior.ColorIndex = 3
End Select
i = i + 1
Next
End With
End Sub
[
[attach]21140[/attach]
[此贴子已经被作者于2006-10-26 21:24:56编辑过]
作者: 方漠 时间: 2006-10-26 23:23
改为如下代码试下:
Select Case CEL.Value
Case Is < 0.9
.Points(i).Interior.ColorIndex = 4
Case is <1.05
.Points(i).Interior.ColorIndex = 27
Case else
.Points(i).Interior.ColorIndex = 3
End Select 作者: ppsnow 时间: 2006-10-27 05:12
还是不对啊 方漠大哥 1111作者: ppsnow 时间: 2006-10-27 05:16
[attach]21176[/attach]
改了你写的那段后还是不对,,,,,,,,,,,,,,,,
else:那为什么还要用那个浏览器啊,,重装别的浏览器就好了阿,,,,,作者: ppsnow 时间: 2006-10-27 07:55
不知不觉已经12点了,做这种工作真是bittersweet,but 女生不适合做这种,,,累人啊,,,还好只是实习,,,作者: 方漠 时间: 2006-10-27 15:56
Private Sub CommandButton2_Click()
Dim ICol, JCol As Integer
Dim myRange, CRange As Range
If Range("26") <= Range("N26") Then
MsgBox "The Beginning date must less than the End date! Please choose again!", vbCritical
Exit Sub
End If
With ActiveChart
.HasTitle = False
.HasLegend = False
With .ChartGroups(1)
.Overlap = 0
.GapWidth = 2
.VaryByCategories = False
End With
End With
i = 1
ActiveSheet.ChartObjects(2).Activate
With ActiveChart.SeriesCollection(1)
For Each CEL In CRange 'Range("b22:bc22")
Select Case CEL.Value
Case Is < 0.9
.Points(i).Interior.ColorIndex = 4 'green
Case 0.9 To 1.05
.Points(i).Interior.ColorIndex = 27 'yellow这里我改回来的,不过改和不改一样的,
Case Else
.Points(i).Interior.ColorIndex = 3 'red
End Select
i = i + 1
Next
End With
End Sub 作者: 方漠 时间: 2006-10-27 20:03
是在 Private Sub CommandButton2_Click()事件里.
你在Sub Chartcolor1()将其改成FALSE,但是CommandButton2的事件里又将其设成了TRUE.所以小勾仍在.作者: ppsnow 时间: 2006-10-28 00:29
都改好了, 就是 Case is <1.05
.Points(i).Interior.ColorIndex = 27