+ Reply to Thread
Results 1 to 7 of 7

Break macro using special combination on keybord

  1. #1
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,942

    Break macro using special combination on keybord

    Hi Guys,

    i would like to break macro when user will press special combination of keybord like ctrl +t .

    It is possible?
    How can i do this?

    Now i am refreshin power query table when workbook is closed - it is taking not a little time so i want to give user possiblity to break calculation and exit in normal way.

    How to do this?

    Please save with some examples,
    Jacek

  2. #2
    Registered User
    Join Date
    05-14-2020
    Location
    Mauritius
    MS-Off Ver
    Office 365
    Posts
    97

    Re: Break macro using special combination on keybord

    Hi,

    the normal way to stop or break a macro is the shortcut CTRL+Break(Pause)
    Greetings

    Tor


  3. #3
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,942

    Re: Break macro using special combination on keybord

    thanks i know this method but i am getting error because i am interrupting pwoer qweury refresh:

    Screenshot_30.png

    Jacek

  4. #4
    Registered User
    Join Date
    05-14-2020
    Location
    Mauritius
    MS-Off Ver
    Office 365
    Posts
    97

    Re: Break macro using special combination on keybord

    I guess that the code for refresh is in the Workbook_BeforeClose event then?

    I do not see any other possibility to break the code here. But what i could offer you is, to ask the user if he/she wants to cancel the refresh on closing. then the user can press ESC and the workbook will close without running the refresh. Only they have just to confirm that they really want to stop the refresh.
    Just try it:
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,942

    Re: Break macro using special combination on keybord

    thank you very much. This is very nice!

    can i replace Application.EnableCancelKey = xlErrorHandler with other button like "ctrl + t" or not?

    Jacek

  6. #6
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,942

    Re: Break macro using special combination on keybord

    It is not possible to use other key combinations?

    Jacek

  7. #7
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,942

    Re: Break macro using special combination on keybord

    Anyone can confirm that it not possible to use specific keybord buttons?

    Jacek

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] How to make the combination of numbers and total of that combination should be in range?
    By Darshan Shah in forum Excel Programming / VBA / Macros
    Replies: 38
    Last Post: 06-20-2020, 01:20 PM
  2. [SOLVED] Disable Delete keybord button from VBA
    By jaryszek in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-09-2020, 02:14 AM
  3. VBA to replace special characters with line break
    By saranyabi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-06-2013, 03:11 PM
  4. Key combination won't run my macro.
    By Galvax in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-26-2012, 03:33 PM
  5. what is the keybord short of format painter in excel
    By Rahul Nagar in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-15-2008, 09:24 AM
  6. In Drawing toolbar, All Characters and Symbols of the keybord sho.
    By Parantap in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-15-2006, 09:25 AM
  7. combination macro
    By Crystal in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-20-2005, 04:05 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1