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

Excel 2003. I am using a VBA procedure to step through a worksheet
from bottom to top with a for-to loop, looking at the cell in column A
for each row. If column A contains different text than the previous
cell in column A, I insert a row about that one with text to indicate
what the numbers in each cell refer to. To speed up the process, I
use Application.Calculation=xlManual before starting the loop. As the
loop runs, Excel flashes "Ready" and "Calculate" in the statusbar.
Since the statusbar says "Calculate", I presume it really is
recalculating the sheet each time it inserts a row, thereby slowing
down my procedure. Is Excel really calculating like I think it is?
And, if so, how can I prevent this? Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Unwanted Calculation

Try putting this...

Application.EnableEvents = False

before you start your calculations and reset it with this...

Application.EnableEvents = True

after the calculations are done. However, you should probably include an On
Error trap and put that last statement in its code block just in case your
code "errors out" so that you are not left in a non-enabled state
afterwards.

--
Rick (MVP - Excel)


"Lucky" wrote in message
...
Excel 2003. I am using a VBA procedure to step through a worksheet
from bottom to top with a for-to loop, looking at the cell in column A
for each row. If column A contains different text than the previous
cell in column A, I insert a row about that one with text to indicate
what the numbers in each cell refer to. To speed up the process, I
use Application.Calculation=xlManual before starting the loop. As the
loop runs, Excel flashes "Ready" and "Calculate" in the statusbar.
Since the statusbar says "Calculate", I presume it really is
recalculating the sheet each time it inserts a row, thereby slowing
down my procedure. Is Excel really calculating like I think it is?
And, if so, how can I prevent this? Thanks.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 968
Default Unwanted Calculation

I don't think Excel is calculating, but it sounds like its doing a screen
refresh.

Try putting
Application.screenupdating=false ' at the start

Application.screenupdating=true ' at the end

Charles
___________________________________
The Excel Calculation Site
http://www.decisionmodels.com

"Lucky" wrote in message
...
Excel 2003. I am using a VBA procedure to step through a worksheet
from bottom to top with a for-to loop, looking at the cell in column A
for each row. If column A contains different text than the previous
cell in column A, I insert a row about that one with text to indicate
what the numbers in each cell refer to. To speed up the process, I
use Application.Calculation=xlManual before starting the loop. As the
loop runs, Excel flashes "Ready" and "Calculate" in the statusbar.
Since the statusbar says "Calculate", I presume it really is
recalculating the sheet each time it inserts a row, thereby slowing
down my procedure. Is Excel really calculating like I think it is?
And, if so, how can I prevent this? Thanks.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Unwanted Calculation

Thanks, Rick and Charles. I did disable events and screen updating,
but to no avail. So, I guess this will just remain a mystery. I will
look at the calculation site.
Lucky
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Unwanted Calculation

A last note on this. I looked at the calculation site, and it
mentioned turning off worksheet.enablecalculation, so I tried that.
That eliminated the problem. Thanks again!


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Unwanted Calculation

Hi

I think excel is not evaluating the formula but re-constructing the
formula as every time you delete/insert a row, CELL ADDRESSES CHANGE.

:)

Hemant Hegde
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
unwanted add-in Keith[_3_] Setting up and Configuration of Excel 1 September 22nd 09 03:53 AM
Unwanted Rounding Bigjohn Excel Discussion (Misc queries) 2 May 25th 06 10:34 AM
Unwanted Cells billy2willy Excel Discussion (Misc queries) 2 September 27th 05 09:45 PM
unwanted zeros Greg Carter Excel Programming 4 January 31st 04 03:38 PM
range.calculation with UDF not working when calculation is set to automatic Brian Murphy Excel Programming 5 October 14th 03 07:02 PM


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