Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
TheRobsterUK
 
Posts: n/a
Default Excel VBA - Freeze Worksheet Calculation?


Hi,

Is there any way to freeze (prevent) a number of worksheets from
recalculating when a VBA macro is running?

I have a spreadsheet with about 10 worksheets, most of which are linked
to each other in some way. One of my macros only needs to use the
formulas (and related results) from about 7 of these, so the other 3
are updating all the time but since the results from these are not
needed then they are slowing down my code.

Is there some VBA function for temporarily disabling a worksheets
calculation function? I would need my code to look something like
this:


Code:
--------------------
Worksheet("sheet1").Calculate:False
Worksheet("sheet2").Calculate:False
Worksheet("sheet3").Calculate:False

*Execute the macro code*

Worksheet("sheet1").Calculate:True
Worksheet("sheet2").Calculate:True
Worksheet("sheet3").Calculate:True
--------------------


Is something like this possible?

Thanks
-Rob


--
TheRobsterUK


------------------------------------------------------------------------
TheRobsterUK's Profile: http://www.excelforum.com/member.php...fo&userid=9924
View this thread: http://www.excelforum.com/showthread...hreadid=470599

  #2   Report Post  
Charles Williams
 
Posts: n/a
Default

Worksheet.enablecalculation=false

"TheRobsterUK"
wrote in message
news:TheRobsterUK.1vxi2b_1127675107.1271@excelforu m-nospam.com...

Hi,

Is there any way to freeze (prevent) a number of worksheets from
recalculating when a VBA macro is running?

I have a spreadsheet with about 10 worksheets, most of which are linked
to each other in some way. One of my macros only needs to use the
formulas (and related results) from about 7 of these, so the other 3
are updating all the time but since the results from these are not
needed then they are slowing down my code.

Is there some VBA function for temporarily disabling a worksheets
calculation function? I would need my code to look something like
this:


Code:
--------------------
Worksheet("sheet1").Calculate:False
Worksheet("sheet2").Calculate:False
Worksheet("sheet3").Calculate:False

*Execute the macro code*

Worksheet("sheet1").Calculate:True
Worksheet("sheet2").Calculate:True
Worksheet("sheet3").Calculate:True
--------------------


Is something like this possible?

Thanks
-Rob


--
TheRobsterUK


------------------------------------------------------------------------
TheRobsterUK's Profile:
http://www.excelforum.com/member.php...fo&userid=9924
View this thread: http://www.excelforum.com/showthread...hreadid=470599



  #3   Report Post  
Bruno Campanini
 
Posts: n/a
Default

"TheRobsterUK"
wrote in message
news:TheRobsterUK.1vxi2b_1127675107.1271@excelforu m-nospam.com...

Hi,

Is there any way to freeze (prevent) a number of worksheets from
recalculating when a VBA macro is running?


Use properly in your macro:

Sheets("SheetName").EnableCalculation = True | False


Bruno


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
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? Richard Excel Discussion (Misc queries) 2 May 13th 23 11:46 AM
Comparing a list to a Calendar worksheet. PatrickL Excel Worksheet Functions 0 August 25th 05 04:21 PM
Rename Excel Worksheet Dragon Excel Discussion (Misc queries) 6 June 20th 05 03:19 PM
Excel Range Value issue (Excel 97 Vs Excel 2003) Keeno Excel Discussion (Misc queries) 2 June 13th 05 02:01 PM
Why does Excel 2003 freeze when saving a workbook that has importe NeedToKnow Excel Worksheet Functions 0 February 18th 05 10:07 PM


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