E列の数値によってセルの色を変える
Sub setcolor()
Dim L As Integer
Dim goukei As Long
L = 1 '初期値
Do While Cells(L + 1, 1).Value <> ""'E列に何か入っている間繰り返す。
If IsNumeric(Cells(L, 5)) Then'数値なら
If Cells(L, 5) < 10 Then
Cells(L, 5).Interior.ColorIndex = xlNone
ElseIf 9 < Cells(L, 5) And Cells(L, 5) < 20 Then
Cells(L, 5).Interior.ColorIndex = 36
'Cells(L, 5).Interior.Pattern = xlSolid
'Cells(L, 5).Interior.PatternColorIndex = xlAutomatic
ElseIf 19 < Cells(L, 5) And Cells(L, 5) < 30 Then
Cells(L, 5).Interior.ColorIndex = 6
'Cells(L, 5).Interior.Pattern = xlSolid
'Cells(L, 5).Interior.PatternColorIndex = xlAutomatic
ElseIf 29 < Cells(L, 5) And Cells(L, 5) < 40 Then
Cells(L, 5).Interior.ColorIndex = 44
'Cells(L, 5).Interior.Pattern = xlSolid
'Cells(L, 5).Interior.PatternColorIndex = xlAutomatic
ElseIf 39 < Cells(L, 5) And Cells(L, 5) < 100 Then
Cells(L, 5).Interior.ColorIndex = 45
'Cells(L, 5).Interior.Pattern = xlSolid
'Cells(L, 5).Interior.PatternColorIndex = xlAutomatic
End If
Else
Cells(L, 5).Interior.ColorIndex = xlNone
End If
L = L + 1
Loop
End Sub