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

I am using a number of workbooks that need to have the manual calculation
turned on so I can see the number of documents in the filter at the bottom of
the screen, however when I go to another worksheet then I have to either
remember to hit F9 or change the tools option command. I have to filter on
numerous releases.

Any way that I can toggle this option on and off by pressing a couple keys??
Such at ctrl t to turn it on and ctrl o to turn it off.

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Toggle Macro

Add this to a button


Sub ToggleCalculation()
With Application
If .Calculation = xlCalculationManual Then
.Calculation = xlCalculationAutomatic
Else
.Calculation = xlCalculationManual
End If
End With
End Sub

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Beep Beep" wrote in message
...
I am using a number of workbooks that need to have the manual calculation
turned on so I can see the number of documents in the filter at the bottom
of
the screen, however when I go to another worksheet then I have to either
remember to hit F9 or change the tools option command. I have to filter
on
numerous releases.

Any way that I can toggle this option on and off by pressing a couple
keys??
Such at ctrl t to turn it on and ctrl o to turn it off.

Thanks



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

Hi,

Just adding some... from Bob's,
that you wish to use some sortcut:
Such at ctrl t to turn it on and ctrl o to turn it off.


'if you wish to use sortcut
Sub ActivateSortcut()
Application.OnKey "^t", "OnSC"
Application.OnKey "^o", "OnSC"
End Sub

Sub OnSC()
Application.Calculation = xlCalculationAutomatic
End Sub

Sub OffSC()
Application.Calculation = xlCalculationManual
End Sub

'after you use the sortcut, then turn it off
Sub DeactivateSortcut()
Application.OnKey "^t"
Application.OnKey "^o"
End Sub

--

Regards,

Halim


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Toggle Macro

I bet you meant to use OffSC in one of those lines in the ActivateSortCut (or
ActivateShortcut???) module.



Halim wrote:

Hi,

Just adding some... from Bob's,
that you wish to use some sortcut:
Such at ctrl t to turn it on and ctrl o to turn it off.


'if you wish to use sortcut
Sub ActivateSortcut()
Application.OnKey "^t", "OnSC"
Application.OnKey "^o", "OnSC"
End Sub

Sub OnSC()
Application.Calculation = xlCalculationAutomatic
End Sub

Sub OffSC()
Application.Calculation = xlCalculationManual
End Sub

'after you use the sortcut, then turn it off
Sub DeactivateSortcut()
Application.OnKey "^t"
Application.OnKey "^o"
End Sub

--

Regards,

Halim


--

Dave Peterson
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
Toggle between two workbooks via MACRO Aligi Excel Discussion (Misc queries) 2 July 8th 08 08:43 PM
Toggle comments on or off macro Jim G Excel Discussion (Misc queries) 3 October 5th 06 04:07 AM
Macro Toggle On/Off Chipmunk Excel Programming 4 May 15th 06 08:21 PM
Toggle Macro Michael Excel Programming 5 June 11th 04 03:18 PM
Toggle Macro with KeyStrokes Cesar Zapata[_2_] Excel Programming 0 November 13th 03 05:07 PM


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