Speeding up a part of a procedure
Hi !
Within a procedure, I have written this instructions for deleting :
With Sheet01
'Delete same items
For i = iLast To 1 Step -1
If .Range("d51").Offset(i, 0).Value =
..Range("d51").Offset(i - 1).Value Then
.Range("d51").Offset(i, 0).Delete shift:=xlUp
End If
Application.StatusBar = iLast - i & "/" & iLast
Next
End With
On my PC (IBM ThinkPad - Pentium M - Windows 2000 and Excel
9.0.76-SP3), it works without problem : within a couple of seconds, the
deleting is done.
For a reason I do not understand, it does not work on the PC of my
colleagues (Compacq nc6000 - Pentium M - Windows XP - Excel
10.6789.6626 SP3) : the procedure starts well but on a slower way, than
the speed gradually decreases (I have written a counter in the
statusbar to see this decrease of the speed). with small list it
doesn't really matter but with bigger one (currently the iLast value is
about 2000), it stops Excel ! The sole way to continue is to end the
task in the Windows Task Manager ! And the user has lost the work done
by the macro...
Maybe someone has an idea for replacing this procedure by another one
....
Thanks in advance.
Herve
|