Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Slow Looping

Could someone tell me how to compare one worksheet with another. I'm using
looping but this is just too slow. Could someone tell me how to compare one
sheet with another and drop matching reference numbers beside each matching
number as in the below code. I'm thinking maybe using the Find method would
be faster but am not sure how to use it even after looking at the help..
There is 12,000 rows on the first sheet and 35,000 on the second. Any help
would be much appreciated.


Sub MatchUp()

Dim wss As Object
Dim wsc As Object
Dim T, I
Set wss = Worksheets("Supplers")
Set wsc = Worksheets("11360")

I = 6
Do While wsc.Cells(I, 1) < "END"
T = 6
Do While wss.Cells(T, 1) < "END"
If -wsc.Cells(I, 7) = wss.Cells(T, 5) And wsc.Cells(I, 3) = wss.Cells(T, 3)
And wsc.Cells(I, 8) = "" Then
wsc.Cells(I, 8) = I
wss.Cells(T, 6) = I
End If

T = T + 1
Loop
I = I + 1
Loop
End Sub



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Slow Looping

Matt,

12,000 Finds will take time as well.

Couple of things you could do is

- turn off screen updating

Application.ScreenUpdating = False

- turn off automatic calculation

Application.Calculation = xlCalculationManual

Be sure to reset at some point though (True and xlCalculationAutomatic).

If this isn't enough, another way is to use a filter and create a test
column that can be filtered, and then delete rows that match. Post back if
you want to follow this option.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Matt" wrote in message
...
Could someone tell me how to compare one worksheet with another. I'm

using
looping but this is just too slow. Could someone tell me how to compare

one
sheet with another and drop matching reference numbers beside each

matching
number as in the below code. I'm thinking maybe using the Find method

would
be faster but am not sure how to use it even after looking at the help..
There is 12,000 rows on the first sheet and 35,000 on the second. Any

help
would be much appreciated.


Sub MatchUp()

Dim wss As Object
Dim wsc As Object
Dim T, I
Set wss = Worksheets("Supplers")
Set wsc = Worksheets("11360")

I = 6
Do While wsc.Cells(I, 1) < "END"
T = 6
Do While wss.Cells(T, 1) < "END"
If -wsc.Cells(I, 7) = wss.Cells(T, 5) And wsc.Cells(I, 3) = wss.Cells(T,

3)
And wsc.Cells(I, 8) = "" Then
wsc.Cells(I, 8) = I
wss.Cells(T, 6) = I
End If

T = T + 1
Loop
I = I + 1
Loop
End Sub





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Slow Looping

See Chip Pearson's page for a variety of methods:

http://www.cpearson.com/excel/duplicat.htm

--
regards,
Tom Ogilvy


Matt wrote in message
...
Could someone tell me how to compare one worksheet with another. I'm

using
looping but this is just too slow. Could someone tell me how to compare

one
sheet with another and drop matching reference numbers beside each

matching
number as in the below code. I'm thinking maybe using the Find method

would
be faster but am not sure how to use it even after looking at the help..
There is 12,000 rows on the first sheet and 35,000 on the second. Any

help
would be much appreciated.


Sub MatchUp()

Dim wss As Object
Dim wsc As Object
Dim T, I
Set wss = Worksheets("Supplers")
Set wsc = Worksheets("11360")

I = 6
Do While wsc.Cells(I, 1) < "END"
T = 6
Do While wss.Cells(T, 1) < "END"
If -wsc.Cells(I, 7) = wss.Cells(T, 5) And wsc.Cells(I, 3) = wss.Cells(T,

3)
And wsc.Cells(I, 8) = "" Then
wsc.Cells(I, 8) = I
wss.Cells(T, 6) = I
End If

T = T + 1
Loop
I = I + 1
Loop
End Sub





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Slow Looping


"Tom Ogilvy" schreef in bericht
...
See Chip Pearson's page for a variety of methods:

http://www.cpearson.com/excel/duplicat.htm


see:
http://users.skynet.be/onderland/Excel.htm
dubbelgangers.

a .xla add-in for difference between sheets on rows or on records.
try it

--
regards,
Tom Ogilvy


Matt wrote in message
...
Could someone tell me how to compare one worksheet with another. I'm

using
looping but this is just too slow. Could someone tell me how to compare

one
sheet with another and drop matching reference numbers beside each

matching
number as in the below code. I'm thinking maybe using the Find method

would
be faster but am not sure how to use it even after looking at the help..
There is 12,000 rows on the first sheet and 35,000 on the second. Any

help
would be much appreciated.


Sub MatchUp()

Dim wss As Object
Dim wsc As Object
Dim T, I
Set wss = Worksheets("Supplers")
Set wsc = Worksheets("11360")

I = 6
Do While wsc.Cells(I, 1) < "END"
T = 6
Do While wss.Cells(T, 1) < "END"
If -wsc.Cells(I, 7) = wss.Cells(T, 5) And wsc.Cells(I, 3) = wss.Cells(T,

3)
And wsc.Cells(I, 8) = "" Then
wsc.Cells(I, 8) = I
wss.Cells(T, 6) = I
End If

T = T + 1
Loop
I = I + 1
Loop
End Sub







  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Slow Looping

Thanks Bob

I would be interested in finding the solution you suggest using filtering.


"Bob Phillips" wrote in message
...
Matt,

12,000 Finds will take time as well.

Couple of things you could do is

- turn off screen updating

Application.ScreenUpdating = False

- turn off automatic calculation

Application.Calculation = xlCalculationManual

Be sure to reset at some point though (True and xlCalculationAutomatic).

If this isn't enough, another way is to use a filter and create a test
column that can be filtered, and then delete rows that match. Post back if
you want to follow this option.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Matt" wrote in message
...
Could someone tell me how to compare one worksheet with another. I'm

using
looping but this is just too slow. Could someone tell me how to compare

one
sheet with another and drop matching reference numbers beside each

matching
number as in the below code. I'm thinking maybe using the Find method

would
be faster but am not sure how to use it even after looking at the help..
There is 12,000 rows on the first sheet and 35,000 on the second. Any

help
would be much appreciated.


Sub MatchUp()

Dim wss As Object
Dim wsc As Object
Dim T, I
Set wss = Worksheets("Supplers")
Set wsc = Worksheets("11360")

I = 6
Do While wsc.Cells(I, 1) < "END"
T = 6
Do While wss.Cells(T, 1) < "END"
If -wsc.Cells(I, 7) = wss.Cells(T, 5) And wsc.Cells(I, 3) = wss.Cells(T,

3)
And wsc.Cells(I, 8) = "" Then
wsc.Cells(I, 8) = I
wss.Cells(T, 6) = I
End If

T = T + 1
Loop
I = I + 1
Loop
End Sub







Reply
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
Looping Maggie[_6_] Excel Discussion (Misc queries) 6 October 2nd 08 09:14 PM
Slow Excel Navigation with Up / Down Arrow and slow scrolling deddog Excel Discussion (Misc queries) 0 August 14th 07 09:56 PM
Looping David T Excel Discussion (Misc queries) 2 August 30th 06 10:51 PM
Looping Stuart[_9_] Excel Programming 0 October 29th 03 11:31 PM
Looping J.E. McGimpsey Excel Programming 0 October 29th 03 11:09 PM


All times are GMT +1. The time now is 09:57 PM.

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

About Us

"It's about Microsoft Excel"