Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 465
Default Re-establish function on exiting workbook


HI All

I use this code to turn Automatic Calculation to Manual when I open my
workbook :


Private Sub Workbook_Open()


With Application
.Calculation = xlManual
.MaxChange = 0.001
.CalculateBeforeSave = False
End With
ActiveWorkbook.PrecisionAsDisplayed = False
End Sub



Can someone advise how to extend this so that it switches Automatic
Calculation back on when I close the workbook?



Thanks


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default Re-establish function on exiting workbook

Why turn Automatic calculation back on when you close the workbook if you
are just going to turn it back off when you open it again? If you want the
cells updated for any changes made, just issue a Calculate or CalculateFull
method in the BeforeClose event.

--
Rick (MVP - Excel)


"Colin Hayes" wrote in message
...

HI All

I use this code to turn Automatic Calculation to Manual when I open my
workbook :


Private Sub Workbook_Open()


With Application
.Calculation = xlManual
.MaxChange = 0.001
.CalculateBeforeSave = False
End With
ActiveWorkbook.PrecisionAsDisplayed = False
End Sub



Can someone advise how to extend this so that it switches Automatic
Calculation back on when I close the workbook?



Thanks



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default Re-establish function on exiting workbook

Hi,

Use the BeforeClose event. Here is a sample:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
With Application
.Calculation = xlAutomatic
.MaxChange = 0.001
End With
End Sub

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"Colin Hayes" wrote:


HI All

I use this code to turn Automatic Calculation to Manual when I open my
workbook :


Private Sub Workbook_Open()


With Application
.Calculation = xlManual
.MaxChange = 0.001
.CalculateBeforeSave = False
End With
ActiveWorkbook.PrecisionAsDisplayed = False
End Sub



Can someone advise how to extend this so that it switches Automatic
Calculation back on when I close the workbook?



Thanks



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 465
Default Re-establish function on exiting workbook

In article , Shane
Devenshire writes
Hi,

Use the BeforeClose event. Here is a sample:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
With Application
.Calculation = xlAutomatic
.MaxChange = 0.001
End With
End Sub



Hi

OK Thanks for that.

How would this merge with my existing code?

Here is what I have presently

Private Sub Workbook_Open()


With Application
.Calculation = xlManual
.MaxChange = 0.001
.CalculateBeforeSave = False
End With
ActiveWorkbook.PrecisionAsDisplayed = False
End Sub



Do I combine the two somehow?

Best wishes.





  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 465
Default Re-establish function on exiting workbook

In article , Rick Rothstein
writes
Why turn Automatic calculation back on when you close the workbook if you
are just going to turn it back off when you open it again? If you want the
cells updated for any changes made, just issue a Calculate or CalculateFull
method in the BeforeClose event.


HI

Well , because I'm running other workbooks which need Automatic
Calculation to been. It's only this one that needs it off when it's
running. When I close this one , I just need a way to have it switch
auto calculation back on , otherwise it interferes with the other
Workbooks. I'm not sufficiently technical to be able to implement your
suggestion , I'm afraid.

Best wishes
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
exiting excel ONLY the workbook will close Brandon Excel Discussion (Misc queries) 12 May 27th 10 09:59 PM
How to establish a maximum and minimum value to a cell jvega Excel Worksheet Functions 3 June 4th 08 08:48 AM
Establish detailed count function Stephen Lim Excel Discussion (Misc queries) 1 March 21st 07 11:00 AM
Help exiting function needed !!! [email protected] Excel Worksheet Functions 0 September 22nd 06 03:18 PM
Excel cannot establish a DDE with WORD rmoritzky Excel Discussion (Misc queries) 0 December 18th 05 02:16 PM


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