delete uncolour row

  • Thread starter Thread starter isybel.harto
  • Start date Start date
I

isybel.harto

Please help me!!
how to delete row where the row is not coloured
 
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--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top