|
ならば「アクティブシートのみの処理」ということにして
Sub Test_X3()
Dim Mi As Long, i As Long
Dim TgR As Range, MyR1 As Range
Dim MyR2 As Range, MyR3 As Range
Set TgR = _
Range("E2", Range("E65536").End(xlUp)).Offset(, 26)
TgR.Formula = _
"=IF($E2=""画面遷移直後"",FALSE,IF($E2<>"""",#N/A,""""))"
On Error GoTo NLine
Set MyR1 = TgR.SpecialCells(3, 4)
Set MyR2 = TgR.SpecialCells(3, 16)
On Error GoTo 0
Mi = Application.Min(MyR1.Count, MyR2.Count)
For i = 1 To Mi
MyR1.Areas(i).Offset(, -25).Resize(, 2).Value = _
Array("○○", "○○○")
Set MyR3 = _
Range(MyR1.Areas(i).Offset(1), MyR2.Areas(i).Offset(-1)) _
.Offset(, -26)
If WorksheetFunction.CountBlank(MyR3) > 0 Then
With MyR3.SpecialCells(4)
.Offset(, -1).ClearContents
.EntireRow.Interior.ColorIndex = 16
End With
End If
Set MyR3 = Nothing
Next i
NLine:
TgR.ClearContents
Set TgR = Nothing: Set MyR1 = Nothing: Set MyR2 = Nothing
End Sub
てな感じです。
|
|