Run macro by pressing F12
Run macro by pressing F12
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Run macro by pressing F12

  1. #1
    Board Regular George J's Avatar
    Join Date
    Feb 2002
    Location
    Edinburgh, Bonnie Scotland
    Posts
    951
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    I have the following code to switch the sheet calculation from Manual (done to speed up another macro - copy & paste lots of detail from other sheets), to Automatic.

    I am not sure how to go about it, but am sure the onkey command is correct.

    Private Sub Worksheet_calculate()
    Application.OnKey "{F12}", "Calculate_Auto"
    End Sub

    Any tips appreciated.



    George J

  2. #2
    MrExcel MVP Ivan F Moala's Avatar
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    4,209
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-03-28 04:49, George J wrote:
    I have the following code to switch the sheet calculation from Manual (done to speed up another macro - copy & paste lots of detail from other sheets), to Automatic.

    I am not sure how to go about it, but am sure the onkey command is correct.

    Private Sub Worksheet_calculate()
    Application.OnKey "{F12}", "Calculate_Auto"
    End Sub

    Any tips appreciated.



    Hi George
    have you tried using the follwoing to switch
    it On/Off ?

    Application.Calculation = xlCalculationManual
    Application.Calculation = xlCalculationAutomatic


    Ivan

  3. #3
    Board Regular George J's Avatar
    Join Date
    Feb 2002
    Location
    Edinburgh, Bonnie Scotland
    Posts
    951
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    The Calculate_Auto macro I am trying to run has that covered (I think). I am really wanting a one key press to revert back to Automatic calculation for the whole sheet. I know pressing F9 refreshes the calculations, but the option is still set to manual.

    Sub Calculate_Auto()
    '
    ' Calculate_Auto Macro
    ' Macro recorded 28/03/2002 by gj
    '

    '
    With Application
    .Calculation = xlAutomatic
    .MaxChange = 0.001
    End With
    ActiveWorkbook.PrecisionAsDisplayed = False
    End Sub

    Any ideas?
    George J

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com