xlam add-in file, then close Excel altogether and re-open it - load your.
See VB_Attribute annotations for more information.Īs for saving your VBA project as an add-in, simply save your VBA project's host workbook as a.
Where "C" will make the hotkey Ctrl+ Shift+ C I'd warmly recommend not using "c" to avoid hijacking Ctrl+ C (Copy).īring up the code inspections toolwindow, hit the "refresh" button under "Rubberduck Opportunities" there should be an inspection result warning about annotations & attributes being out of sync - select "add member attribute" from the "Fix" menu, and you're done - no need to export/edit/import or deal with any obscure syntax, and if you want to change the hotkey, simply edit the comment accordingly and re-synchronize annotations & attributes. Select Enable This Hotkey and check to assign a hotkey to it. Select change that resides on the side of the option. On most mice, these used to be the only buttons before a third one came along with the scroll wheel, increasing the utility of the device specially when reading long documents or browsing lengthy websites. If you're using Rubberduck, forget all of the above and just go to your module in the VBA editor, find the procedure and annotate it like so: Option Sub Calculate() After the cursor option is located, click on it and select general that appears under it, On the right side of the screen, you should be able to locate Lock Cursor Onto Screen click on it. Ever since the mouse was brought to the masses with the success of Windows, it has had two primary buttons: the left click and the right click.
Save the file, import it into your VBA project: Ctrl+ Shift+ C will now invoke that macro.
Perhaps the best mouse macro you can assign to your mouse right now is also the simplest: a macro button on your mouse that acts as a Windows key, opening the Start menu. This is exactly how Excel's macro recorder assigns macro hotkeys: no need for any Application.OnKey work-arounds. After all, powerful shortcuts quickly accessed at the tips of your fingers (literally) saves so much time. Under Public Sub Calculate(), you want to add an attribute so that the file looks like this: Attribute VB_Name = "Module1"Īttribute Calculate.VB_ProcData.VB_Invoke_Func = "C\n14" I'll look like this: Attribute VB_Name = "Module1" So your code file might look like this: Option Explicit Rather, you assign a shortcut to a macro - that is, a Public Sub procedure in your standard module. Furthermore, if you have a mouse with additional buttons, the app lets you remap those too.Ĭonnect with us on Facebook, Twitter, and Google+.You don't assign a shortcut to an add-in. Since X-Mouse Button Control can be used to set multiple profiles on a per-app basis, you can assign other functions for the scroll wheel in different apps. Spinning the wheel will allow you to scroll through any open website or window, just like before. Keep in mind the function you’ve assigned can be used only if you click on the mouse scroll wheel. Click “Apply” and the new function will become usable right away. Simply scroll through the list until you find the function you want to assign and select it. In the default profile, select the middle button and a drop-down menu will appear. While the app allows you to create specific application profiles, for the purpose of this guide we’re going to use the default, generic profile.
Open the app after you download and install it. There are other apps with similar capabilities, so this is not the only option, just the one we recommend.
To accomplish this, we’re going to use a free app called X-Mouse Button Control. The clickable mouse scroll wheel is an extremely common feature and we’re going to show you how you can remap the mouse scroll wheel click function. How to remap the mouse scroll wheel click function