LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 12
Default Filter or sort a macro result

The macro highlights cells and the user wants to sort or filter on the
highlighted rows so they can be deleted. Here's the macro.

Sub finddiff()
Application.ScreenUpdating = False

Range("A2", Range("b6900").End(xlUp)).ClearFormats

For Each x In Range("a2", Range("a6900").End(xlUp))
For Each y In Range("b2", Range("b6900").End(xlUp))
If x.Value = y.Value Then z = 1
Next
If z < 1 Then x.Interior.ColorIndex = 6
z = 0
Next

For Each s In Range("b2", Range("b6900").End(xlUp))

For Each t In Range("a2", Range("a6900").End(xlUp))
If s.Value = t.Value Then v = 1
Next
If v < 1 Then s.Interior.ColorIndex = 6
v = 0
Next

End Sub

 
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
Filter, sort and sum Amy Excel Discussion (Misc queries) 2 March 22nd 07 07:46 PM
Sort column by formula result Ryan Excel Discussion (Misc queries) 3 February 20th 07 10:12 PM
data sort/filter maestro Excel Worksheet Functions 3 September 11th 06 02:53 AM
Filter and sort afdmello Excel Discussion (Misc queries) 1 June 14th 05 08:02 PM
sort data with the same result Mark Excel Worksheet Functions 2 November 10th 04 10:30 AM


All times are GMT +1. The time now is 08:41 PM.

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"