Delete rows if range is null and not in color...
Sub ABC()
Dim cell As Range, r1 As Range
For Each cell In Range("A1:A500")
If cell.Interior.ColorIndex = xlNone Then
If Len(Trim(cell.Text)) = 0 Then
If r1 Is Nothing Then
Set r1 = cell
Else
Set r1 = Union(r1, cell)
End If
End If
End If
Next
If Not r1 Is Nothing Then
r1.EntireRow.Delete
End If
End Sub
worked for me. Assumes the interior color is not produced by conditional
formatting.
--
Regards,
Tom Ogilvy
"jeremiah" wrote:
My spreadsheets has rows that are in color w/null values. There are others
that are just null and no color. I need to figure out how to delete only the
rows that have nulls, but not the ones that have color and also null. I have
searched and can't find quite the right response to my question. Thanks for
the help.
Jeremiah
|