Folks,
Let's say I have :
Header : row #1
The rest of data to filter : row #2 till the end (max at 2,000 rows)
How to do filter based on background color at column B?
What I want is : if color index <> 24 then delete all rows (starting from row #2)
This code is working, but it takes a long time to process 1,500 rows. Is there any suggestion to speed it up ?
Sub DeleteCells()
Application.ScreenUpdating = False ' To freeze the display
For I = 1500 To 2 Step -1
If Cells(I, "B").Interior.ColorIndex <> 24 Then Cells(I,"B").EntireRow.Delete
Next I
Application.ScreenUpdating = True
End Sub
Thanks in advance
Let's say I have :
Header : row #1
The rest of data to filter : row #2 till the end (max at 2,000 rows)
How to do filter based on background color at column B?
What I want is : if color index <> 24 then delete all rows (starting from row #2)
This code is working, but it takes a long time to process 1,500 rows. Is there any suggestion to speed it up ?
Sub DeleteCells()
Application.ScreenUpdating = False ' To freeze the display
For I = 1500 To 2 Step -1
If Cells(I, "B").Interior.ColorIndex <> 24 Then Cells(I,"B").EntireRow.Delete
Next I
Application.ScreenUpdating = True
End Sub
Thanks in advance