conditional formats(Dave can you explan the code you gave me)
Posted by steve on February 10, 2001 6:24 PM
Dave I tryed this code and it didn't work. It's exactly like the code you gave me, I changed the range to A1:E10 and it didn't work, so I changed it back and it still didn't work. Also I don't understand the second line of code, wouldn't that make it never run because the cases are all greater than 1. You also said that I need to change the limits, I'm pretty sure that has something to do with line 3 but, I don't know what I should change it to.
Thanks for all the help you've been giving me in improving my knowledge of VBa. I'm kind of new to VBa programing, but I know some C+ which makes learning VBa a little easier.
Thanks again, Steve
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then
Select Case Target
Case 1 To 5
Target.Interior.ColorIndex = 6
Case 6 To 11
Target.Interior.ColorIndex = 46
Case 12 To 17
Target.Interior.ColorIndex = 5
Case 18 To 23
Target.Interior.ColorIndex = 15
Case 24 To 29
Target.Interior.ColorIndex = 50
End Select
End If
End Sub