Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Speeding up a part of a procedure

If you've done a file|print or a file|print preview, you'll see page break
indicator lines on the worksheet.

If you're deleting rows, excel wants to determine where these lines should
be--and that slows things down.

And being in view|page break preview will cause the same problem.

Try putting a couple of lines like these at the top of your routine:

ActiveSheet.DisplayPageBreaks = False
ActiveWindow.View = xlNormalView


You may want to turn calculation to manual at the start and change it back when
your code is done.


" wrote:

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


--

Dave Peterson
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
Need help speeding this up KD[_5_] Excel Programming 0 March 24th 06 05:17 PM
help with speeding this up... Simon Excel Programming 16 April 26th 05 03:25 AM
speeding up vlookup Lolly[_2_] Excel Programming 2 February 16th 05 03:00 PM
selection.find shortening the procedure by skipping the "activate" part Peter[_21_] Excel Programming 1 November 10th 04 11:56 PM


All times are GMT +1. The time now is 10:43 AM.

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"