1

I have added two macros to "Quick Access Toolbar"(QAT). Macros are for navigating left and right in the sheet, like when you press arrows at the bottom right corner of the workbook. When you press them they are shifting cells left and right one cell at the time; you need to keep clicking on them to continue moving left(or right). I would like to make them run continuously, like when you press arrows at the bottom right; excel keeps changing columns when arrow is pressed and stops when you release it. Macro needs to keep running(changing cells) when mouse click is pressed and stops when I release it. Is this possible, can this functionality be added to buttons on the QAT.

  • 1
    A button only fires a "I've been clicked" event when it's clicked - you'd need to do some serious Win32 hijacking to make it say "I'm being clicked" continuously as the mouse button is being held down. – Mathieu Guindon Aug 16 '19 at 17:41
3

This can be done using the ubiquitous AutoHotkey.

First step : Find the keyboard shortcut of the macros on the QAT.

Press ALT to display the shortcut numbers of QAT items, giving you the Alt+number shortcut to the item. Let us say that the number of your QAT item was 8.

Second step : Create a AutoHotkey script to continuously execute the QAT item.

The following code will be activated by a long press on the F12 key. It will send to Excel Alt+8 every half a second until the F12 key is released

Copy the following into an .ahk file, possibly changing "F12" and "8". Double-click the file to start it executing. It will create a green "H" icon in the traybar that you can right-click and select Exit to stop. If you always want this script to execute, copy it to the user Startup folder at C:\Users\<user name>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup.

SetTitleMatchMode, 2
#IfWinActive Excel

F12::
Loop:
KeyWait, F12, T0.5
err := Errorlevel
if (err) {
  Send, {LAlt}8
  Goto, Loop
}
return
  • I was looking for native excel solution. Also I would like "Scrolling" to happen when icon on QAT is pressed down with left mouse key, not keyboard button. – IGRACH Aug 19 '19 at 8:53
  • 1
    Adding a feature such as long-press to the QAT is possible only to a Microsoft developer. We do what we can. – harrymc Aug 19 '19 at 9:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.