delete uncolour row

  • Thread starter Thread starter isybel.harto
  • Start date Start date
Please help me!!
how to delete row where the row is not coloured

Hi Isybel

It depends on how and when you want to delete them.
Do you want to this procedure once, or more often?

I'd say write a function which goes through all rows, look up the
interior.color value and delete those who are = xlnone
If you need help doing that, just ask.

hth

Carlo
 
I think this will give you what you want:
Sub DeleteAllUncolored()

Dim ClrRng As Range

Set ClrRng = Range("A1", Range("A5000").End(xlUp))
For Each cell In ClrRng
If cell.Interior.ColorIndex = xlNone Then
cell.EntireRow.Delete
End If
Next cell
End Sub

As always, be extremely careful when deleting date; try this macro on a
sample before you execute on your actual data.

Regards,
Ryan--
 
Back
Top