|
こちらでテストしてみましたが
>"画面遷移直後"の下の行(表でいうと行13)から"テンキー"(不特定項目)の1つ上までの行
>(行20)をグレーに塗り潰しし、D列クリアを、いくつかある、"画面遷移直後"の下の
>行(不特定)からイベント某(不特定項目)の1つ上までの行(不特定)毎に行う
は、完全に出来てましたが。強いて言うと冒頭のところも直さないといけないので
Sub Test_X2()
Dim Ck As Variant
Dim Sti As Long, Mi As Long
Dim i As Long, j As Long
Dim TgR As Range, MyR1 As Range
Dim MyR2 As Range, MyR3 As Range
Ck = Application.Match("画面遷移直後", Worksheets(1).Range("E:E"), 0)
If IsError(Ck) Then
Sti = 2
Else
Sti = 1
End If
For j = Sti To Worksheets.Count
Set TgR = _
Sheets(j).Range("E2", Sheets(j).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
If Err.Number <> 0 Then Err.Clear
Next j
End Sub
と、しなくてはいけなかったですが。
|
|