Hi
try the following macro:
Sub delete_rows()
Dim lastrow As Long
Dim row_index As Long
Application.ScreenUpdating = False
lastrow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row
For row_index = lastrow - 1 To 1 Step -1
If Cells(row_index, "B").interior.colorindex= 42 then
Rows(row_index).delete
End If
Next
Application.ScreenUpdating = True
End Sub
You may have to adapt the line
If Cells(row_index, "B").interior.colorindex= 42 then
to your specific colorindex (as my color palette looks differently and
I'm not sure which color you have chosen). To get your colorindex try
the following:
- format a cell with this color and select this cell
- open the VBA editor and in the immediate window enter
?Activecell.interior.colorindex