View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Janis Janis is offline
external usenet poster
 
Posts: 360
Default need to delete all rows that are gray

Sub deleteColoredRows()

Const Gray = 15
Range("A1").EntireRow.Select
Do While ActiveCell.Value < ""
if Selection.Interior.ColorIndex = Gray
EntireRow.Delete
End If
Loop

End Sub

assuming I have the right color index number, how do I correct the if/then
line
so I can delete all rows that are gray? there is an error on the delete and
if/then lines

thanks,