Join Curt Frye for an in-depth discussion in this video Triggering a procedure using a specific key sequence, part of Learning VBA in Excel (2010).
Many Excel users prefer to use keyboard shortcuts, instead of the mouse, to…manipulate the program.…If you, or your colleagues would rather press a key sequence to run a macro, you…can assign one, either in VBA or within the program.…If you record a macro and you want to assign a key sequence to it, you can do so…from within the Micros dialog box.…Just click View > Macros, and when you go to record your macro, you can assign a shortcut key.…I assume you're familiar with that aspect of the program, so I won't go into detail.…To show you what that looks like in VBA, I'll press Alt+F11 and go to the…Visual Basic Editor.…
Here is the code we're going to be running.…It's the RandomPrize drawing that we used earlier.…The question is, how do you start that macro?…And the answer is that you assign a Function key.…You can't do that here though, in a regular code module.…I am in Code module 1.…To do that, you need to create an event handler in the ThisWorkbook code module.…I have two event handlers:…one for the workbook_Activate event and the second for the…
- Working in the Visual Basic Editor
- Adding code to a macro
- Creating, exporting, and deleting code modules
- Declaring and using variables
- Managing variable scope
- Defining arrays
- Managing workbooks and worksheets with VBA
- Repeating tasks with loops
- Debugging VBA code
- Cutting, copying, and pasting cell data
- Running and triggering event procedures
Skill Level Advanced
Excel 2016: Power Query (Get & Transform)with Oz du Soleil1h 49m Intermediate
1. Introducing Visual Basic for Applications (VBA)
2. Defining Variables, Constants, and Calculations
3. Adding Logic to Your VBA Code
4. Debugging Your VBA Code
5. Managing Workbook Elements and Data in VBA
6. Adding Advanced Elements to Your Workbook
7. Using Excel Events in Your VBA Code
8. Putting It All Together
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.