To remove direct formatting from selected text in Word VBA while keeping its assigned styles, reset both its character and paragraph formatting: copy the selection into a Range, then call Font.Reset and ParagraphFormat.Reset. These operations restore formatting from the underlying styles rather than deleting the text.
What “remove formatting” means in Word
Word formatting comes from more than one place. A paragraph style, such as Normal or Heading 1, supplies a set of defaults. Direct formatting consists of changes applied on top of those defaults, such as making a word bold, changing its font size, adding paragraph spacing, or changing alignment. Character formatting affects selected characters; paragraph formatting affects the paragraph or paragraphs containing the selection.
This distinction matters because “remove formatting” can mean different things. You might want to remove only bold and font-color overrides while retaining a heading style, or you might want to make text look plain by changing its style too. A reset to styles addresses the first goal. It does not erase the style itself, and it does not necessarily make all text visually identical: a heading style may still be larger and bold after its direct overrides are removed.
Word’s Home tab also has a Clear All Formatting command, and keyboard shortcuts can reset character or paragraph formatting. VBA is useful when the same operation must be repeated, applied to a selected passage with one command, or run over a larger document. The correct macro depends on whether you want to preserve styles and how wide a range you intend to affect.
VBA for selected text
Select the text first, then run this macro. It resets direct character formatting on the selected characters and direct paragraph formatting in every paragraph touched by the selection. If the selection crosses several paragraphs, all of those paragraphs are affected, even if you selected only a few characters in one of them.
Sub ResetFormattingOfSelection()
Dim target As Range
' Work on the current selection without replacing it.
Set target = Selection.Range
' Restore character and paragraph formatting from their styles.
target.Font.Reset
target.ParagraphFormat.Reset
End Sub
In Word for Microsoft 365 on Windows, open the VBA editor with Alt+F11, insert a standard module using Insert > Module, and paste the code there. Return to Word and run it from Developer > Macros, or press Alt+F8, select ResetFormattingOfSelection, and choose Run. If the Developer tab is missing, enable it in Word’s ribbon options. On Mac, use Developer > Visual Basic to open the editor; if Developer is not shown, enable it in Word’s Ribbon & Toolbar settings. The editor and macro dialogs can look different on Mac, but the Word VBA calls are the same.
What the reset changes—and what it preserves
Font.Reset restores character formatting to the formatting defined by the applicable style. That can remove direct changes to properties such as bold, italic, font name, size, color, and highlighting when those properties are not part of the style. ParagraphFormat.Reset similarly restores paragraph-level settings from the style, including properties such as alignment, indentation, and spacing when they have been directly overridden.
The macro does not remove the selected words, rewrite them as plain text, or automatically assign the Normal style. It also does not mean every paragraph will end up with the same appearance. A title, heading, and body paragraph can retain distinct appearances because their styles differ. This is often desirable in a well-structured document: the direct formatting is cleaned up, but the document’s heading hierarchy remains available for navigation and other features.
Other document features have their own behavior. List numbering and bullets are not simply character or paragraph font settings, and a reset is not a reliable way to remove a list. Borders, shading, table properties, page layout, and section breaks may also involve separate settings. Check the result rather than assuming that one formatting reset is a universal “make everything plain” command.
Apply the reset to the whole document
If the goal is to reset the main body of the current document, the same methods can be applied to the document’s content range. This is broader than a selection macro, so use it only when you intend to affect every paragraph in the main document story.
Sub ResetFormattingInMainDocument()
Dim target As Range
' Content covers the main document story.
Set target = ActiveDocument.Content
' Reset direct formatting while retaining the assigned styles.
target.Font.Reset
target.ParagraphFormat.Reset
End Sub
ActiveDocument.Content does not necessarily include every place where text can appear in a Word file. Headers, footers, footnotes, endnotes, comments, and text inside some drawing objects belong to separate stories or containers. If those areas also need attention, handle them separately and verify the outcome. A macro aimed at the main content should not be described as a complete cleanup of every story in the document.
For large or important documents, test the macro on a copy or on a small selection before applying it broadly. Style definitions themselves are not edited by these reset calls, but the visual result can still change substantially when many direct overrides are removed.
Choosing between VBA, the ribbon, and shortcuts
For a one-off cleanup, the Word interface is usually quicker. Select the text and use Home > Font > Clear All Formatting on Windows. The command’s location or label can vary slightly in the Mac ribbon, but look on the Home tab. It is a useful visual command when you want Word to clear formatting without writing or running a macro. Its result is not identical to a carefully targeted VBA reset in every possible situation, so inspect styles, lists, and paragraph layout afterward.
On Windows, Ctrl+Spacebar removes manual character formatting from selected text, while Ctrl+Q resets paragraph formatting. These are useful when you want to handle character and paragraph formatting separately. They are not a single “clear every kind of formatting” shortcut. Mac keyboard mappings differ by Word version and configuration; using the Home tab controls is a dependable alternative when a shortcut is uncertain.
- Choose the ribbon command for a quick, visible cleanup of a passage.
- Use Ctrl+Spacebar or Ctrl+Q on Windows when you specifically want to reset character or paragraph formatting, respectively.
- Use VBA when you need a repeatable operation, a custom command, or a carefully controlled range.
- Change the style itself only when the style definition—not an individual passage’s overrides—is what needs correction.
Common problems and how to diagnose them
The text still looks formatted. That may be expected: the paragraph or character style still supplies formatting. Check the style shown on the Home tab. If the text has a heading style, for example, resetting direct formatting does not turn it into Normal text. Apply the intended style separately if changing the document structure is part of the goal.
More of a paragraph changed than expected. Paragraph formatting belongs to paragraphs, not just the characters highlighted on screen. Resetting ParagraphFormat on a range that intersects a paragraph can reset that paragraph’s direct paragraph settings. Select whole paragraphs when you want the target to be obvious, or omit the paragraph reset if you only intend to clear character formatting.
The macro appears to do nothing. Confirm that the selection contains the intended text, that the macro was run from a standard module, and that Word permits macros to run. A protected document or restricted editing area can prevent changes. If you placed the cursor without selecting text, the range may represent only the insertion point, so select text or a paragraph before running the selection version.
Lists or tables remain unusual. Bullets, numbering, table styles, cell shading, and borders can be controlled independently from the font and paragraph properties reset here. Use the relevant list or table controls to correct those features, rather than repeatedly running the same macro and expecting it to remove unrelated formatting.
Safety, reversibility, and macro storage
Save a copy of the document before running a macro that changes a large selection or the whole document. Word macros cannot be undone with Ctrl+Z, so the normal Undo history is not a dependable recovery plan after a macro runs. If the result is wrong, close without saving and reopen the copy, or restore from a separate saved version.
Save macro code in a macro-enabled Word document (.docm) or in a trusted template if you want to keep it available. A regular .docx file does not store VBA macros. Word may display a security warning or block macros according to the computer’s security settings; only enable or run code you understand and trust. A formatting-reset macro does not need to access the internet or other files, so unexpected code doing so deserves scrutiny.
Frequently Asked Questions
Does Word VBA remove formatting but keep styles?
Yes. Resetting Font and ParagraphFormat on a range removes direct overrides and restores formatting from the assigned styles. The styles remain, so headings and body text can still look different.
How do I remove only bold formatting with VBA?
For selected text, set its font’s bold property to false: Selection.Font.Bold = False. This removes bold from the selection, but it does not reset other direct formatting such as font size, color, or paragraph spacing.
Can I remove all formatting from a Word document at once?
You can reset direct character and paragraph formatting across ActiveDocument.Content, but that covers the main document story, not necessarily headers, footers, notes, or text in drawing objects. It also preserves assigned styles, which may continue to format the text.
Why does Ctrl+Space not remove paragraph spacing?
On Windows, Ctrl+Spacebar resets character formatting. Paragraph spacing is paragraph formatting, so Ctrl+Q is the corresponding reset shortcut. You can also use ParagraphFormat.Reset in VBA.
Can I undo a Word macro with Ctrl+Z?
No. Word macros cannot be undone through Ctrl+Z like ordinary editing actions. Save a separate copy before running a macro, especially one that affects the entire document.
Related
- How to Insert Figures Into a Table of Contents in Word
- Insert an Editable Checkbox in Word: A Step-by-Step Guide
- Insert an Electronic Signature in Word
Try it: the Column Letter to Number: aA is 27, XFD is 16,384. Converts both ways.
More in VBA & macros
- Excel VBA MkDir: Create Folders and Handle Errors SafelyIn Excel VBA, use the MkDir statement to create a folder: MkDir "C:\Reports\November". The parent folder, C:\Reports, must…
- Excel UserForm Grid Size: Spacing, Settings, and LayoutIn Excel VBA, a UserForm’s design grid is adjustable in the Visual Basic Editor; it does not have…
- Excel VBA Active Worksheet Reference ExplainedIn Excel VBA, use ActiveSheet to refer to the sheet currently active in the active workbook. For a…
- Excel VBA: Check If a String Contains a Substring in a CellIn Excel VBA, use InStr to check whether one string contains another: it returns a position greater than…
- Excel VBA Not Working? Diagnose Common Macro ProblemsIf Excel VBA is not working, first check that you are using the desktop version of Excel, the…
- VBA Range Address: Get, Set, and Understand ReferencesIn Excel VBA, use a range’s Address property to return its cell reference as text: for example, Range("B2:D5").Address…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.