View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Howard Howard is offline
external usenet poster
 
Posts: 536
Default Deleting rows which are not highlighted

On Sunday, February 3, 2013 11:38:43 PM UTC-8, protocoder wrote:
Dear Experts



I have a huge data to work excel running into 8 thousand rows, I run a

unique macro which highlights the data which are of interest. This macro

changes the color of the first coloumn. Now I need a further request to

document such differences which means I need to delete all the rows

whose first row is not yellow. Can I get some help please.



Existing Conditions

1. Data running in 8 thousand+ or more rows.

2. Some rows has only FIRST COLUMN highlighted yellow because of the

macro I run



Requirements:

Now I need to Delete rest of all the rows whose FIRST COLUMN is NOT

Yellow.



Please can I get help.









--

protocoder


Seems like Claus' solution make good sense.
If that doesn't work for you try this.

Option Explicit

Sub NoYellar()
Dim lRow As Long
Dim c As Range

With Sheets("sheet1")
lRow = .Cells(.Rows.Count, 1).End(xlUp).Row
For Each c In .Range("A1:A" & lRow)
If c.Interior.ColorIndex < 6 Then
c.EntireRow.ClearContents
End If
Next
End With
End Sub

Regards,
Howard