Hi,
Is it possible to toggle between manual and automatic calculation with vba?
Regards
Nath
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Toggle Calculation (2003)
Yes, you can use
Application.Calculation = xlCalculationManual
Application.Calculation = xlCalculationAutomatic
and
Application.Calculation = xlCalculationSemiAutomatic
to set calculation to manual, automatic and automatic except tables, respectively. It can be very useful to set calculation to manual at the beginning of a macro that changes many values that will affect formulas, then set it to automatic again at the end (this will trigger a full recalculation).
>Is it possible to toggle between manual and automatic calculation with vba?
Thought-provoking question, thanks.
Of greater interest (to me, at any rate), is how to hook the three “Application.Calculation” values into a deep and meaningful relationship with “Application.Volatile”.
My (novel) understanding of “Application.Volatile” is that when set to True it forces recalculation of the cell using the UDF whenever recalculation occurs anywhere in the worksheet (but Help doesn’t make it clear whether they mean Workbook or Spreadsheet).
Inhibiting automatic calculation (Application.Calculation = xlCalculationManual) means that calculation will take place only when I tap the F9 key.
Then if “Application.Volatile=True” I’ll see my UDF results updated, but if “Application.Volatile=False” I’ll see my UDF remain unchanged, unless the input variables change.
In short, one needs a multi-dimensional table to track through the combinations and their benefits.
One dimension would be “testing/production”, since when I’m testing UDFs I don’t necessarily need to see every cell updated.
One dimension would be “Volatile” settings
One dimension would be “Calculation” settings.
In today’s version of XL2003/VBA help (v6.5) the Volatile setting is listed as a Method; I think it ought to be listed as a Property.
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.
Notifications