LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default remove colored rows

Try this.

Sub DeleteAll_colored()
Dim RowNdx As Long
Dim LastRow As Long
LastRow = ActiveSheet.UsedRange.Rows.Count
For RowNdx = LastRow To 1 Step -1
If Cells(RowNdx, "A").Interior.ColorIndex < xlNone Then
Rows(RowNdx).Delete
End If
Next RowNdx
End Sub


Gord Dibben MS Excel MVP

On Wed, 7 Nov 2007 22:39:02 -0800, climate
wrote:

Hi thank's ryguy7272
1- My colored cells have different color(green,yellow,....).
2- your macro work's cell to cell, not for entire columns,please response to
these questions.
regards
"ryguy7272" wrote:

Hummm, similar post earlier this morning...
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 = 3 Then
cell.EntireRow.Delete
End If
Next cell
End Sub

This assumes that cells are colored red!! This site is great to see which
numbers correspond to which colors in Excel:
http://www.mvps.org/dmcritchie/excel/colors.htm

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

Regards,
Ryan--

--
RyGuy


"climate" wrote:

Hi
I have 2 columns that many of it's rows has colored ( colored cells in
first and second column is equal) , i want to remove colored rows.
Would you please help me?
regards
climate


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I remove Duplicate rows? 85225 Excel Discussion (Misc queries) 15 March 9th 07 11:41 PM
How do I remove empty Rows Rodders Excel Discussion (Misc queries) 2 January 12th 07 12:04 PM
How to remove a lot of rows? Please help User Excel Discussion (Misc queries) 2 April 30th 06 08:39 PM
count colored rows NoviceLois Excel Discussion (Misc queries) 1 December 28th 05 11:52 PM
sort according to the colored rows swchee Excel Discussion (Misc queries) 2 August 18th 05 04:07 AM


All times are GMT +1. The time now is 04:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"