|
IV列を作業列にし、数式を埋めこんで判定〜セル着色する方法を提示します。
データ量が多いと、こちらの方が高速に処理できると思います。
Sub Check_String()
Dim MyR As Range, GetR As Range
Dim Ad As String
On Error GoTo ErLine
Set MyR = Range("B:B").SpecialCells(2, 2)
Ad = MyR.Cells(1).Address(0)
With MyR.Offset(, 254)
.Formula = _
"=IF(OR(" & Ad & "=""A""," & Ad & "=""B""," & Ad & "=""C""),1,"""")"
Set GetR = .SpecialCells(3, 1).EntireRow
GetR.SpecialCells(2, 1).Interior.ColorIndex = 8
Intersect(MyR, GetR).Interior.ColorIndex = 8
.ClearContents
End With
ErLine:
Set MyR = Nothing: Set GetR = Nothing
End Sub
|
|