Perfect, it works! Here's what I made.
Sub ColorByChange()
Dim counter As Integer
counter = 1
Do
counter = counter + 1
ActiveChart.SeriesCollection(1).Points(counter - 1).Select
With Selection.Interior
If Cells(counter, 3).Value = 1 Then
.ColorIndex = 3
ElseIf Cells(counter, 3).Value = 2 Then
.ColorIndex = 46
ElseIf Cells(counter, 3).Value = 3 Then
.ColorIndex = 6
ElseIf Cells(counter, 3).Value = 4 Then
.ColorIndex = 4
ElseIf Cells(counter, 3).Value = 5 Then
.ColorIndex = 50
ElseIf Cells(counter, 3).Value = 6 Then
.ColorIndex = 10
ElseIf Cells(counter, 3).Value = 7 Then
.ColorIndex = 42
ElseIf Cells(counter, 3).Value = 8 Then
.ColorIndex = 41
ElseIf Cells(counter, 3).Value = 9 Then
.ColorIndex = 49
ElseIf Cells(counter, 3).Value = 10 Then
.ColorIndex = 13
ElseIf Cells(counter, 3).Value = 11 Then
.ColorIndex = 13
ElseIf Cells(counter, 3).Value = 12 Then
.ColorIndex = 13
ElseIf Cells(counter, 3).Value > 12 Then
.ColorIndex = 1
End If
.Pattern = xlSolid
End With
Loop Until counter > 45
End Sub
- I made it a Do loop that repeats specifically 45 times. How might I turn it into a While statement that is flexible?
- Also, is there any way to make a legend out of the colors I've just set?
- Finally, is it possible to color using the RGB scale rather than the Color Index?
Thank you so much for your help! You've saved me a lot of time.
Edited by Rhionin, 28 July 2009 - 02:45 AM.