top of page

MS Excel: Macros & VBA Shortcuts for Windows and Mac

  • Writer: Fakhriddinbek
    Fakhriddinbek
  • May 8
  • 2 min read

Macros and VBA (Visual Basic for Applications) are powerful tools in Microsoft Excel that allow users to automate repetitive tasks, build advanced data manipulation routines, and customize Excel functionality.


Excel spreadsheet showing slide with text "Comprehensive Macros and VBA Shortcuts in Microsoft Excel 2021". Visible toolbar and gridlines.

Whether you're editing VBA code or simply recording and running macros, using the right shortcuts can drastically increase your speed and coding efficiency.


Why Use Macros & VBA Shortcuts?


Using shortcuts for macros and VBA helps you:

  • Write and edit VBA code faster

  • Navigate the VBA Editor efficiently

  • Record and run macros with fewer clicks

  • Automate complex Excel tasks with ease


Whether you’re a beginner learning to record macros or an advanced VBA developer, these shortcuts will help streamline your workflow.


Macros & VBA Shortcuts in Excel (Windows & Mac)


General Macro Actions

Action

Windows Shortcut

Mac Shortcut

Open Macro Dialog Box

Alt + F8

Option + F8

Run Selected Macro

Alt + F8 → Select → Enter

Option + F8 → Select → Return

Open Visual Basic Editor (VBE)

Alt + F11

Fn + Option + F11 (or Alt + F11 if supported)

Stop a Running Macro

Esc

Esc

Record a Macro

Alt + T + M + R

Tools → Macro → Record (via ribbon)

Open Record Macro dialog

Alt + T + M + R

N/A

Open Macro Security Settings

Alt + T + M + S

N/A

Mac may require you to access some macro tools through the menu bar as shortcut support is limited.


Visual Basic for Applications (VBA) Editor Shortcuts


These shortcuts work when you're in the VBA Editor (Visual Basic for Applications).

Action

Windows Shortcut

Mac Shortcut

Insert a Module

Alt + I, M

N/A (Use menu: Insert > Module)

Insert a Procedure

Ctrl + Shift + I

⌘ + Shift + I

Comment selected code

Ctrl + Shift + C

⌘ + Shift + C

Uncomment selected code

Ctrl + Shift + X

⌘ + Shift + X

Run Sub/UserForm

F5

F5

Step Into (debug line by line)

F8

F8

Step Over

Shift + F8

Shift + F8

Step Out

Ctrl + Shift + F8

⌘ + Shift + F8

Add Watch

Shift + F9

Shift + F9

Toggle Breakpoint

F9

F9

Immediate Window (focus)

Ctrl + G

⌘ + G

Toggle Full Module View

Ctrl + R

⌘ + R

Find

Ctrl + F

⌘ + F

Replace

Ctrl + H

⌘ + H

Go To

Ctrl + G (in editor)

⌘ + G

Save project

Ctrl + S

⌘ + S

Quick Access Tips


  • Alt + F11 is your best friend—it’s the quickest way into the coding world of Excel.

  • Use F8 to step through code when debugging to understand each line’s effect.

  • Combine Ctrl + R and Ctrl + G in the VBA editor to navigate projects and modules quickly.


Conclusion


While Excel’s Macros and VBA environment is heavily mouse-driven, these shortcuts can help both beginners and experienced users write and debug code more efficiently. From recording macros to stepping through VBA procedures, mastering these key combinations unlocks the full power of Excel automation.




Commentaires


bottom of page