sorry about that
just change the = --> <>, and <> --->=, and it will be fixed
Sub rick()
With ActiveSheet
lastcol = .UsedRange.Columns(.UsedRange.Columns.Count).Column
startcol = 1
Range("A1").Select
For thiscol = startcol To lastcol Step 1
If Selection.Interior.Color <> 255 Then Selection.EntireColumn.Delete Shift:=xlToLeft '<---this says, if the interior color is NOT equal to 255 (red), then select the entire column and delete
If Selection.Interior.Color = 255 Then ActiveCell.Offset(, 1).Select '<---this says, if the interior color IS equal to 255 (red), then offset by one column and try again
Next thiscol
End With
End Sub
Bookmarks