|
色々な書き方があると思いますが、一例です。(テスト未済。)
Sub ChangeColor()
Dim rng1 As Range
Dim rng2 As Range
Dim rng3 As Range
Set rng1 = Range("A1")
Set rng2 = Range("B1")
Set rng3 = Range("C1")
Select Case Time
Case Is <= CDate("10:00")
Case Is <= CDate("11:00")
If rng1.Value Like "*○○*" And rng2.Value Like "*い*" Then
rng1.Interior.ColorIndex = 3
End If
Case Is <= CDate("12:00")
If rng1.Value Like "*△△*" And rng3.Value Like "*う*" Then
rng1.Interior.ColorIndex = 4
End If
Case Is <= CDate("13:00")
If rng1.Value Like "*□□*" And rng3.Value Like "*う*" Then
rng1.Interior.ColorIndex = 5
End If
'以下同様につき省略
End Select
End Sub
|
|