Sub Test()
Rows.Hidden = False
DoIt 44
End Sub
Private Sub DoIt(DColor)
Dim rngC As Range, c As Range, x As Long
Set rngC = Range(Cells(6 + 1, 21), Cells(Rows.Count, 21).End(xlUp))
For x = rngC.Cells.Count To 1 Step -1
If rngC.Cells(x).DisplayFormat.Interior.ColorIndex = DColor Then _
rngC.Cells(x).EntireRow.Hidden = True
Next x
End Sub
|