logo
search
Document Editing Problems

How to Create a Shortcut to Swap Adjacent Letters in Word

Maira MehtabMaira Mehtab Sep 20, 2026 869 views

Question details

The user wants to find or create a keyboard shortcut to instantly transpose two adjacent letters in a word (for example, fixing "Owrry" to "Worry").

Product
Microsoft Word
Device & OS
not provided
Scenario
Fixing common typing errors quickly without manually deleting and retyping the characters.
Observed behavior
The user needs a fast way to transpose letters like "Reailty" into "Reality" using a simple keyboard shortcut, as there is no built-in keybind for this action.
Before you start

Ensure that the Developer tab is enabled in your Word ribbon, as you will need to access the Visual Basic Editor to create this macro.

Solution 1Recommended

Create a Custom VBA Macro to Transpose Characters

Since Word does not have a built-in shortcut to swap adjacent letters, you can create a simple VBA macro and assign a custom shortcut key to it.

This solution uses a Visual Basic for Applications (VBA) macro saved in your Normal.dotm template so it remains available for all documents. The macro script identifies the selected characters or the characters surrounding the cursor, inserts the second character before the first, and deletes the duplicate.

1
Open the VBA Editor

Press Alt + F11 on your keyboard to open the Visual Basic for Applications (VBA) editor in Microsoft Word.

2
Insert a New Module

In the Project Explorer pane on the left side, right-click on 'Normal', select 'Insert', and then click on 'Module'.

3
Add the Transpose Macro

Paste a VBA script designed to transpose characters into the blank module window. The code should check if two characters are selected, insert the second one before the first, and remove the original text.

4
Save the Macro

Press Ctrl + S to save the changes to your Normal.dotm template, then close the VBA editor window.

5
Assign a Keyboard Shortcut

Go to File > Options > Customize Ribbon. Click the 'Customize' button next to 'Keyboard shortcuts'. In the Categories list, select 'Macros', find your new transpose macro, click the 'Press new shortcut key' box, type a combination (like Alt + Right Arrow), and click 'Assign'.

Saving to Normal.dotm: By saving the macro in the Normal template, you ensure that the shortcut will work in any new or existing Word document you open on your computer.
Fast Document Editing with WPS

Edit Documents Efficiently in WPS Writer

WPS Writer provides robust text editing features and supports custom macros, allowing you to quickly fix typos and streamline your writing process just like you would in Microsoft Word.

  1. 1. Open WPS Writer: Launch WPS Office and open your document in WPS Writer.
  2. 2. Access Developer Tools: Navigate to the Developer tab to access the Macro and VBA editor.
  3. 3. Create Your Macro: Insert a new module and write or paste your character-swapping VBA script.
  4. 4. Assign a Shortcut: Use the customization settings to map a keyboard shortcut to your new macro for instant typo fixing.
Fully compatible with Microsoft Word (.docx) file formatsSupports VBA macros for advanced text automation and custom shortcutsLightweight application with a familiar, easy-to-use interfaceFree alternative offering powerful document editing tools
microsoft office alternative - wps office

Frequently Asked Questions

Does Microsoft Word have a default shortcut to transpose letters?

No, unlike some text or code editors, Microsoft Word does not include a built-in keyboard shortcut for transposing adjacent letters. You must create a custom macro to achieve this functionality.

Can I use this macro in all my Word documents?

Yes, if you save the macro in the Normal.dotm template instead of the current document, it will be globally available across all new and existing documents on your computer.

How do I enable the Developer tab to access the macro editor?

Go to File > Options > Customize Ribbon. In the right-hand pane under 'Main Tabs', check the box next to 'Developer' and click OK to make the tab visible.

What if I accidentally swap the wrong letters using the macro?

You can simply press Ctrl + Z to undo the macro action and revert the letters to their original state.