LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
GUS GUS is offline
external usenet poster
 
Posts: 45
Default campare list too slow

I am using the macro below in order to compare two lists at column A and B
But the code is too slow
it takes 2 hours to complete (pentium IIII 2.4 GHz)
is there any idea for a faster way of comparing lists with 20.000 data in a
row?

(The code delete any content at column A if find it at column A)

Sub Comparing()
Dim A As Range, B As Range, C As Range
Dim i%, y%, z%
Set A = Columns(1)
Set B = Columns(2)
i = 1: y = 1: z = 1
Do Until IsEmpty(A.Cells(i))
Do Until IsEmpty(B.Cells(y))
If A.Cells(i) = B.Cells(y) Then
A.Cells(i).ClearContents
z = z + 1: y = 1
Exit Do
End If
y = y + 1
Loop
i = i + 1: y = 1
Loop
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
Slow Tab Tony7659 Excel Discussion (Misc queries) 0 August 5th 09 09:49 PM
VERY SLOW Yousoft Excel Discussion (Misc queries) 1 December 11th 07 12:56 PM
Slow Excel Navigation with Up / Down Arrow and slow scrolling deddog Excel Discussion (Misc queries) 0 August 14th 07 09:56 PM
Why Del is Slow Ananth Excel Discussion (Misc queries) 2 August 3rd 07 04:26 PM
Why so slow max Excel Discussion (Misc queries) 1 February 27th 06 02:38 PM


All times are GMT +1. The time now is 05:44 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"