Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default accelerate in loop

I'v script do some work.
I'd like accelerate its.
I want go to place "do while" (with counter i+1) if VBA
perform any/one condition without complete remainder block
of if.
Any suggestions would be much appreciated
Regards
Mark

Below example:

do while ...........

if cells(i,...... then
.....
end if

if cells(i,...... then
.....
end if

if cells(i,...... then
.....
end if

i=i+1
loop
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default accelerate in loop

Mark,

Is this what you want?

do while ...........

if cells(i,...... then
.....

elseif cells(i,...... then
.....

elseif cells(i,...... then
.....
end if

i=i+1
loop


You could also do a couple of other things to speed it up.

1. If there is a lot of changes to the active window, you could turn off
screen updating at the start
Application.ScreenUpdating = False
Set it back to True at the end.

2. If here are a lot of formulae, if any celss get amended, automatic
calculation might be kicking in all of the time. SO turn it off
Application.Calculation = xlCalculationManual
and set it back to automatic at the en d
Application.Calculation = xlCalculationAutomatic

--

HTH

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

"Mark" wrote in message
...
I'v script do some work.
I'd like accelerate its.
I want go to place "do while" (with counter i+1) if VBA
perform any/one condition without complete remainder block
of if.
Any suggestions would be much appreciated
Regards
Mark

Below example:

do while ...........

if cells(i,...... then
....
end if

if cells(i,...... then
....
end if

if cells(i,...... then
....
end if

i=i+1
loop



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default accelerate in loop

Its work effect!
Thx Bob for this and another tips.
Sincerely
Mark

-----Original Message-----
Mark,

Is this what you want?

do while ...........

if cells(i,...... then
.....

elseif cells(i,...... then
.....

elseif cells(i,...... then
.....
end if

i=i+1
loop


You could also do a couple of other things to speed it up.

1. If there is a lot of changes to the active window, you

could turn off
screen updating at the start
Application.ScreenUpdating = False
Set it back to True at the end.

2. If here are a lot of formulae, if any celss get

amended, automatic
calculation might be kicking in all of the time. SO turn

it off
Application.Calculation = xlCalculationManual
and set it back to automatic at the en d
Application.Calculation = xlCalculationAutomatic

--

HTH

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

"Mark" wrote in message
...
I'v script do some work.
I'd like accelerate its.
I want go to place "do while" (with counter i+1) if VBA
perform any/one condition without complete remainder

block
of if.
Any suggestions would be much appreciated
Regards
Mark

Below example:

do while ...........

if cells(i,...... then
....
end if

if cells(i,...... then
....
end if

if cells(i,...... then
....
end if

i=i+1
loop



.

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
Find loop doesn't loop JSnow Excel Discussion (Misc queries) 2 June 24th 09 08:28 PM
getting out of a if loop rk0909 Excel Discussion (Misc queries) 3 April 11th 06 03:55 PM
Help with Do...Loop Noemi Excel Discussion (Misc queries) 1 December 7th 05 12:59 AM
How to create a worksheet to accelerate debts Excel_Challenged Excel Worksheet Functions 0 May 6th 05 07:31 PM
HELP!!!! Can't stop a loop (NOT an infinite loop) TBA[_2_] Excel Programming 3 December 14th 03 03:33 PM


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