siva
10-21-2007, 05:38 AM
I would like to change "fill color" base on certain numerical value and change lines based on Alphabet.
The shape is in "Visual" Sheet and the values in "DATA" sheet.
Below is my code.
The fill colors does change according to the values in "Data" sheet but the Line colors does not change.
Anyone can help?
Thanks
Siva
Dim W As String
Private Sub Update_Click()
With Me.Shapes("B01_").Fill.ForeColor
Select Case Sheets("Data").Range("B3").Value
Case 0.01 To 0.28: .SchemeColor = 2
Case 0.29 To 0.3: .SchemeColor = 53
Case 0.31 To 0.5: .SchemeColor = 52
Case 0.51 To 0.9: .SchemeColor = 51
Case 0.91 To 1: .SchemeColor = 17
Case Else: .SchemeColor = 1
If Sheets("Data").Range("J3") = W Then
With Me.Shapes("B01_").Line.ForeColor
Shapes("B01_").Line.DashStyle = msoLineDash
Shapes("B01_").Line.Style = msoLineSingle
Shapes("B01_").Line.Visible = msoTrue
Shapes("B01_").Line.ForeColor.SchemeColor = 2
End With
End If
End Select
End With
End Sub
The shape is in "Visual" Sheet and the values in "DATA" sheet.
Below is my code.
The fill colors does change according to the values in "Data" sheet but the Line colors does not change.
Anyone can help?
Thanks
Siva
Dim W As String
Private Sub Update_Click()
With Me.Shapes("B01_").Fill.ForeColor
Select Case Sheets("Data").Range("B3").Value
Case 0.01 To 0.28: .SchemeColor = 2
Case 0.29 To 0.3: .SchemeColor = 53
Case 0.31 To 0.5: .SchemeColor = 52
Case 0.51 To 0.9: .SchemeColor = 51
Case 0.91 To 1: .SchemeColor = 17
Case Else: .SchemeColor = 1
If Sheets("Data").Range("J3") = W Then
With Me.Shapes("B01_").Line.ForeColor
Shapes("B01_").Line.DashStyle = msoLineDash
Shapes("B01_").Line.Style = msoLineSingle
Shapes("B01_").Line.Visible = msoTrue
Shapes("B01_").Line.ForeColor.SchemeColor = 2
End With
End If
End Select
End With
End Sub