Office Settings & Configuration

How to Create Keyboard Shortcuts for Shading Colors in Word

Nimra MalikNimra Malik Oct 21, 2026 869 views

Question details

The user needs a method to assign custom keyboard shortcuts to instantly apply specific shading colors to text selections in Microsoft Word.

How to Create Keyboard Shortcuts for Shading Colors in Word
Product
Microsoft Word
Device & OS
not provided
Scenario
Editing and formatting documents where multiple distinct shading colors need to be applied frequently to highlight different types of information.
Observed behavior
Microsoft Word lacks native keyboard shortcuts to apply specific background shading colors directly, requiring users to navigate the ribbon menu manually.
Before you start

Ensure the Developer tab is enabled in your Word ribbon, as you will need to paste a brief VBA macro code to create these custom color shortcuts.

Solution 1Recommended

Create VBA Macros and Assign Custom Keys

Use a simple VBA script to define your desired shading colors, then bind those scripts to custom key combinations like F2 or F3 via the Customize Ribbon settings.

By storing these custom macros in the Normal.dotm global template, your newly assigned shading shortcuts will remain available across all future Word documents.

1
Open the VBA Editor

Press Alt + F11 to launch the Visual Basic for Applications (VBA) editor in Microsoft Word.

2
Insert a New Module

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

3
Paste the Macro Code

Type or paste your macro code into the module. For example: Sub ShadeRed() Selection.Shading.BackgroundPatternColor = wdColorRed End Sub Sub ShadeGreen() Selection.Shading.BackgroundPatternColor = wdColorGreen End Sub

4
Access Customize Keyboard Settings

Close the VBA editor. Back in Word, navigate to File > Options > Customize Ribbon, and click the 'Customize' button next to 'Keyboard shortcuts' at the bottom of the window.

5
Assign Shortcuts to Your Macros

In the 'Categories' list, scroll down and select 'Macros'. Select 'ShadeRed' from the Macros list on the right, click inside the 'Press new shortcut key' box, press your desired key (e.g., F2), and click 'Assign'. Repeat this process for your other color macros.

Create VBA Macros and Assign Custom Keys
Save Template Prompt: When closing Word, if prompted to save changes to the Normal.dotm template, ensure you click 'Save' so your shortcuts are permanently retained.
Efficient Editing

Apply Text Shading Quickly with WPS Office

WPS Office Writer offers an intuitive, streamlined interface for applying text shading and highlights effortlessly. It is fully compatible with Microsoft Word document formats, allowing for fast editing without requiring complex VBA setups.

  1. 1. Open your document in WPS Writer: Launch WPS Office and open your .doc or .docx document.
  2. 2. Select the target text: Highlight the text, paragraph, or table cell you wish to shade.
  3. 3. Apply Shading: Navigate to the Home tab and click the 'Character Shading' or 'Highlight' icon to instantly apply your selected color.
  4. 4. Use Format Painter: To apply the exact same shading color elsewhere efficiently, double-click the Format Painter tool and brush over other text blocks.
Free and lightweight Office suiteFully compatible with Microsoft Word (.docx) formatsIntuitive and clean interface for text formattingEasy-to-use Format Painter for replicating shading styles rapidly
microsoft office alternative - wps office

Frequently Asked Questions

Can I assign a keyboard shortcut to the standard highlight tool in Word without macros?

Yes, you can assign a shortcut to the general Highlight tool by navigating to Customize Keyboard > All Commands > Highlight. However, this will only trigger the currently selected highlight color in your ribbon, whereas VBA macros allow you to assign different dedicated keys to different specific colors simultaneously.

Why do my custom shortcut keys disappear when I restart Word?

This typically happens if your macro or keyboard shortcuts were saved to the current document instead of the global template. When assigning the shortcut, ensure the 'Save changes in' dropdown is set to 'Normal.dotm'. Also, make sure to accept any prompts to save the global template upon exiting Word.

What are the VBA color codes for other shading colors like blue or yellow?

In VBA, you can use built-in constants to specify colors. Some common constants include wdColorBlue, wdColorYellow, wdColorLightBlue, wdColorBrightGreen, or wdColorGray25. Simply replace 'wdColorRed' in your macro code with one of these standard Word color constants to achieve the desired shade.