Calculate sheet macro

Russk68

Well-known Member
Joined
May 1, 2006
Messages
589
Office Version
  1. 365
Platform
  1. MacOS
Hi All,
I need a macro that will set calculations to manual when a sheet is opened and calculate the sheet with the Enter key.

Your help is greatly appreciated!
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Re: Need help with calculate sheet macro

Enter this in "ThisWorkbook" object:

Code:
Private Sub Workbook_Open()

Application.Calculation = xlManual


Application.OnKey "~", "myMacro1"


End Sub

And in a module:


Code:
Sub myMacro1()

Application.Calculation = xlAutomatic


End Sub
 
Upvote 0
Re: Need help with calculate sheet macro

Hi
I haven't had a chance to try this yet but thank you very much for the code!

Russ
 
Upvote 0
Hi
I just wanted to know if I was doing this right.
To enter in ThisWorkbook, right click on ThisWorkbook, View Code and paste code?

Add in a Module, right click ThisWorkbook, Insert> Module and paste code?
 
Upvote 0
Cool!
I may not have explained myself well.
I want the workbook to always be in Manual mode.
In any worksheet when I hit enter, I want just that worksheet to calculate each time.
I think your code is calculating the workbook with the Enter key. Is that correct?
 
Upvote 0
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; white-space: inherit;">That is correct.

Try replacing Application.Calculation = xlAutomatic with ActiveSheet
.Calculate</code>
 
Upvote 0

Forum statistics

Threads
1,214,891
Messages
6,122,105
Members
449,066
Latest member
Andyg666

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top