HELP


Posted by eddie g on October 04, 2001 10:37 AM

i need a macro that will delete rows based on the color of a cell, for example, if the cells in range a1-a500 are yellow but some have no color, i want the macro to delete the rows where the cell has no color.

Posted by faster on October 04, 2001 10:46 AM

this should do it:

Sub DelColor()

If MsgBox("Delete Colors?", vbYesNo) = vbNo Then
Exit Sub
End If

Range("A1").Select
Do While Selection <> ""
If Selection.Interior.ColorIndex = xlNone Then
Selection.EntireRow.Delete
Else
Selection.Offset(1, 0).Select
End If
Loop
Range("A1").Select
End Sub



Posted by eddie g on October 04, 2001 11:11 AM

thanks faster