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

The following simple routines turn off/on Auto Calc
Sub AutoCalcOff()
With Application
.Calculation = xlManual
.MaxChange = 0.001
End With
ActiveWorkbook.PrecisionAsDisplayed = False
End Sub

Sub AutoCalcOn()
With Application
.Calculation = xlAutomatic
.MaxChange = 0.001
End With
ActiveWorkbook.PrecisionAsDisplayed = False
End Sub

How can I combine the 2 and toggle between on and off with a shortcut
key...Unless of course this is built into Excel already. I know If I switch
to manual that F9 will recalc but I want to be able to turn off and on via
shortcut key. And a recalc when It is turned on would be nice too :-)
Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Toggle AutoCalc

One way:

Assign this to your shortcut key:

Public Sub ToggleCalc()
ActiveWorkbook.PrecisionAsDisplayed = False
With Application
If .Calculation = xlCalculationManual Then
.Calculation = xlCalculationAutomatic
Else
.Calculation = xlCalculationManual
.MaxChange = 0.001
End If
End With
End Sub

Setting Calculation to automatic will automatically recalc.

In article ,
"Sandy" wrote:

The following simple routines turn off/on Auto Calc
Sub AutoCalcOff()
With Application
.Calculation = xlManual
.MaxChange = 0.001
End With
ActiveWorkbook.PrecisionAsDisplayed = False
End Sub

Sub AutoCalcOn()
With Application
.Calculation = xlAutomatic
.MaxChange = 0.001
End With
ActiveWorkbook.PrecisionAsDisplayed = False
End Sub

How can I combine the 2 and toggle between on and off with a shortcut
key...Unless of course this is built into Excel already. I know If I switch
to manual that F9 will recalc but I want to be able to turn off and on via
shortcut key. And a recalc when It is turned on would be nice too :-)
Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 355
Default Toggle AutoCalc

Thank you!

"JE McGimpsey" wrote:

One way:

Assign this to your shortcut key:

Public Sub ToggleCalc()
ActiveWorkbook.PrecisionAsDisplayed = False
With Application
If .Calculation = xlCalculationManual Then
.Calculation = xlCalculationAutomatic
Else
.Calculation = xlCalculationManual
.MaxChange = 0.001
End If
End With
End Sub

Setting Calculation to automatic will automatically recalc.

In article ,
"Sandy" wrote:

The following simple routines turn off/on Auto Calc
Sub AutoCalcOff()
With Application
.Calculation = xlManual
.MaxChange = 0.001
End With
ActiveWorkbook.PrecisionAsDisplayed = False
End Sub

Sub AutoCalcOn()
With Application
.Calculation = xlAutomatic
.MaxChange = 0.001
End With
ActiveWorkbook.PrecisionAsDisplayed = False
End Sub

How can I combine the 2 and toggle between on and off with a shortcut
key...Unless of course this is built into Excel already. I know If I switch
to manual that F9 will recalc but I want to be able to turn off and on via
shortcut key. And a recalc when It is turned on would be nice too :-)
Thanks!


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
AutoCalc duketter Excel Discussion (Misc queries) 4 July 24th 08 09:21 PM
Links not updating - autocalc is on M Scott Excel Discussion (Misc queries) 4 December 20th 06 06:18 PM
MS excel incorrect autocalc? MiniReefKeeper Excel Worksheet Functions 4 July 4th 06 02:13 PM
autocalc to complicated to turn off lasse Setting up and Configuration of Excel 2 January 10th 06 12:31 AM
turn off autocalc barrfly[_3_] Excel Programming 1 June 7th 05 02:30 PM


All times are GMT +1. The time now is 08:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"