- #Option button on keyboard how to
- #Option button on keyboard code
- #Option button on keyboard download
Just choose BeforeClose in the drop-down on the right and call the same macro. You can also add an event to delete the macro anytime you close the workbook.
#Option button on keyboard code
In our case, the code would read “Call Module1.CreateShortcut” (without the quotation marks). Add a line of code to call the macro that you've created. That will add the Workbook_Open event.In the VB Editor, double-click on ThisWorkbook in the Project Window.
#Option button on keyboard how to
Here are instructions on how to set it up (see the video above for more details). However, you can actually automate this by using the Workbook_Open and Workbook_BeforeClose events. This allows you to setup different shortcuts for different macros all at the same time. For example, if we were using Ctrl+ C instead, the keyboard shortcut would revert back to performing the Copy action when Ctrl+ C is pressed.īoth the Create and Delete macros can have multiple lines of code with the OnKey method. This also resets the key combination to any native Excel keyboard shortcuts. The absence of a procedure tells Excel not to assign an action to that combination of keyboard strokes. Instead of “CreateShortcut” we will call it “DeleteShortcut” and we remove the procedure name (“CellColorGreen”) from the code. I've typed it just below the section for creating the shortcut. In this case, we want the key combination to run the macro called “CellColorGreen”.Īs you can also see in the image above, the code to delete this process is simple.
This is especially true if you have to perform the same actions repeatedly.
#Option button on keyboard download
Assign-Keyboard-Shortcut-to-Macro.zip Download Create Your Own Keyboard Shortcuts to Run MacrosĪssigning keyboard shortcuts to simple or complex macros can help you work faster in Excel.