|
-
Sep 25th, 2005, 01:48 PM
#1
Thread Starter
Hyperactive Member
*Resolved* 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
Last edited by TheRobster; Oct 6th, 2005 at 06:13 PM.
http://www.sudsolutions.com
-
Sep 25th, 2005, 01:52 PM
#2
Re: Excel VBA: Freeze Worksheet Calculation?
I think the best you could do is to only calculate a range instead of an entire sheet or workbook.
VB Code:
Worksheets(1).Rows(8).Calculate
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Sep 25th, 2005, 02:51 PM
#3
Lively Member
Re: Excel VBA: Freeze Worksheet Calculation?
Depending on what your needs are, ManualCalculation may help also
VB Code:
With Application
.Calculation = xlCalculationManual
Sheet1.Calculate
Sheet2.Calculate
' chain more sheets together as needed
'your macro
.Calculation = xlCalculationAutomatic
End With
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|