|
ON さんこんにちは
識者からの回答が有るまでのつなぎで
Sub a指定行非表示2() 'D列のセルがグレーなら行非表示
Dim TG As Range
Dim ck As Integer
' Dim myArray() As String
Dim cnt_i As Integer
Dim myArray
cnt_i = 1
ck = ActiveSheet.UsedRange.Rows.Count
Range(Cells(1, 4), Cells(ck, 4)).Select
For Each TG In Selection
If TG.Interior.ColorIndex = 15 Then
myArray = myArray & TG.Row & ":" & TG.Row & ","
Debug.Print myArray
End If
cnt_i = cnt_i + 1
Next
'Rows(3).EntireRow.Hidden = True
Range(Mid(myArray, 1, Len(myArray) - 1)).Select '無理やり?
' Rows(myArray(ck)).Select '←型が一致しません
'Rows(myArray(ck)).EntireRow.Hidden = True
Range(Mid(myArray, 1, Len(myArray) - 1)).EntireRow.Hidden = True
End Sub
|
|