|
こういった話ですか?(反応ないですが、こちらも忙しいので)
Sub test()
Dim k As Long
Dim s As String
Dim expectation As String
For k = 1 To Cells(1, 1).End(xlDown).Row
s = Cells(k, 1).Value
If Left(s, 4) = "重要番号" Then
Select Case s
Case "重要番号1111", "重要番号1112", "重要番号1116", "重要番号1119"
expectation = "特別に対処不要"
Case Else
expectation = "殿に連絡"
End Select
Else
Select Case s
Case "開始", "終了"
expectation = "対処不要"
Case "重要情報"
expectation = "殿に連絡"
Case Else
expectation = "想定外"
End Select
End If
If expectation = "想定外" Then
Cells(k, 3).Value = "想定した文字列以外です"
Else
If expectation <> Cells(k, 2).Value Then
Cells(k, 3).Value = "これはNG"
'ここで Cells(k, 2)に色をつける
End If
End If
Next
End Sub
|
|