Global keys
Visual Basic
Use these key combinations in all Visual Basic windows.
Press | To |
---|---|
F5 | Run a Sub/UserForm or macro. |
F8 | Execute code one line at a time. |
SHIFT+F8 | Execute statements one line at a time without stepping into procedure calls. |
CTRL+BREAK | Stop running a Visual Basic application. |
CTRL+G | Display the Immediate window. |
CTRL+TAB | Switch between windows. |
ALT+F5 | Runs the error handler code or returns the error to the calling procedure. Does not affect the setting for error trapping on the General tab of the Options dialog box. |
ALT+F8 | Steps into the error handler or returns the error to the calling procedure. Does not affect the setting for error trapping on the General tab of the Options dialog box. |
Windows
Use these key combinations in all Windows-based applications.
Press | To |
---|---|
F1 | Open Help. |
ALT+F6 | Toggle between the last two active windows. |
ALT+F4 | (Visual Basic) Close the active window; if all windows are closed, close Visual Basic. |
CTRL+C or F3 | Copy the selection to the Clipboard. |
CTRL+X | Cut the selection to the Clipboard. |
CTRL+V | Paste the Clipboard selection. |
CTRL+Z | Undo the last edit. |
SHIFT+F10 | View the shortcut menu. |
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for