
Originally Posted by
flunzy
It works for the first lines but not for the rest of the file.
Thanks for the clarification! My initial understanding was that there would only be one red cell, which is why my initial effort only caught the first one. Shifting the order of a few of my lines should fix that:
Sub SpreadRed()
Dim i As Long
Dim LR As Long
Dim RedNo As Long
Application.ScreenUpdating = False
LR = Cells(Rows.Count, "I").End(xlUp).Row
For i = 2 To LR
If Cells(i, "I").Interior.ColorIndex = 3 Then
RedNo = Cells(i, "I").Value
Range("I1:I" & LR).AutoFilter Field:=1, Criteria1:=RedNo
Range("I2:I" & LR).SpecialCells(xlCellTypeVisible).Interior.ColorIndex = 3
ActiveSheet.AutoFilterMode = False
End If
Next i
Application.ScreenUpdating = True
End Sub
Bookmarks