|
For i = 1 To 200
If Val(Cells(i, 4).Value) >= "1" And Val(Cells(i, 4).Value) <= "10" Then
MsgBox "1〜10"
ElseIf Val(Cells(i, 4).Value) >= "11" And Val(Cells(i, 4).Value) <= "20" Then
MsgBox "11〜20"
ElseIf Val(Cells(i, 4).Value) >= "21" And Val(Cells(i, 4).Value) <= "30" Or _
Val(Cells(i, 4).Value) >= "41" And Val(Cells(i, 4).Value) <= "50" Then
MsgBox "21〜30 or 41〜50"
Else
MsgBox "?"
End If
Next
----
For i = 1 To 200
Select Case Val(Cells(i, 4).Value)
Case 1 To 10
Cells(i, 4).Interior.ColorIndex = 3
Case 11 To 20
Cells(i, 4).Interior.ColorIndex = 4
Case 21 To 30, 41 To 50
Cells(i, 4).Interior.ColorIndex = 5
Case Else
Cells(i, 4).Interior.ColorIndex = 0
End Select
Next
|
|