Heading

This is some text inside of a div block.
This is some text inside of a div block.
This is some text inside of a div block.
min read

Delete current paragraph

Word • Macros • Editing
Peter Ronhovde
6
min read

As much as we writers hate to delete our precious words on the screen, it's as necessary as an outhouse is to a 19th century farm. In fact, deleting the current paragraph is one of the first macros I ever wrote for myself, and I hate to say it's probably one of my most used ones.

Thanks for your interest

This content is part of a paid plan.

How it's usually done ...

So, how do we normally delete a paragraph in Microsoft Word? Hold down delete and watch the cursor chew up the letters?

Example of deleting text character by character (ugh!)
Example of deleting text character by character (ugh!)

Horrid as well as a time waster!

Or grab the mouse and select the paragraph before pressing the delete key?

Example of a more efficient way to delete a paragraph of text (better)
Example of a more efficient way to delete a paragraph of text (better)

Although using the mouse is not bad, it usually feels faster than it is.

A better way ...

You could speed up both methods by deleting whole words at a time (Command+Delete on Mac or Control+Backspace on Windows) or using the keyboard to select the paragraph in the second case, but why not transform it into a single keystroke?

Example of quickly deleting the current paragraph with a single shortcut
Example of quickly deleting the current paragraph with a single shortcut

Enter macros in Word

Microsoft added macros to its office suite way back in 1993 to allow us to automate repetitive tasks. The macros are written or recorded in near English-like steps using Visual Basic for Applications (VBA). VBA was and still is more popular in Excel, but many Word power users (writers being one group) neglect its utility to speed up their own everyday writing and editing tasks.

Create the empty macro

We first need to create an empty macro for the upcoming paragraph delete command. If you're new to the idea, the easiest approach is to start recording a macro but stop recording before doing anything. If you want a more careful directions on getting started, see our Creating an empty VBA macro article.

I assigned this macro to a keyboard shortcut Command+Shift+Delete on Mac or Control+Shift+Delete in Windows, but shortcuts are definitely a matter of preference, so use what you like.

Then just open the Word VBA editor using Option+F11 on a Mac or Alt+F11 in Windows. The empty macro will look something like the following in the VBA editor:

VBA editor with a new empty macro
VBA editor with a new empty macro

Focusing on the text, our specific empty macro today will be:

Sub DeleteParagraph()
' Delete the current paragraph

End Sub

The extra description in green at the top is a comment meant for you, the human reader. All comments start with a single quote character in VBA. You may omit comments if you wish, but as things get more complicated, it's a good idea to include some non-trivial explanations of what you're doing because you may not remember what you were thinking six months from now. The above comment is redundant with such a simple macro, but it doesn't hurt to leave it.

Delete the paragraph

Let's first look at a get 'er done version without any high falutin' talky-talk fluff.

After you've got your empty macro, believe it or not, deleting the current paragraph is just a single-line VBA command. Create an empty line after the comment (if you kept it) and add:

Selection.Paragraphs.First.Range.Delete

Final macro (already?)

The whole macro will look like:

Sub DeleteParagraph()
' Delete the current paragraph
Selection.Paragraphs.First.Range.Delete
End Sub

And ... you're done. Notice how the macro works even if the paragraph is not yet selected or if only a portion of the paragraph is selected. This saves time grabbing the mouse or tapping out additional shortcuts.

We usually indent the commands of a macro to make them easier to distinguish from the start and end of the macro, but it is not technically required in VBA.

This macro does not need the clipboard. The contents are just deleted.

I love this macro for its simplicity and utility. Like I said, I hate how much I use it, but it is definitely a workhorse of a macro. The farm wouldn't run as efficiently without it.

Be sure to save

Save the macro (Command+S on Mac or Control+S in Windows) and then boom ... from now on, one keyboard shortcut deletes the current paragraph in Word. No selection necessary. No keyboard calisthenics. Just move on with your work.

Dissecting the workhorse

Uh ... that sounds a little gross, but for those that want a little more, let's unpack the tidy, one-line command.

Selection.Paragraphs.First.Range.Delete

Notice how the VBA command reads almost like English which is one of the plusses with using it.

Where is the insertion point?

Selection tells Word to work with the currently selected text or the current insertion point location (not the mouse pointer) in the document. If no document content is selected, Selection refers to the location of the blinking "I-bar" (it's a little more subtle than that, but let's go with it).

Selection

The Selection is like a specialized document range because it is literally a region of spanned document content. In fact, Ranges are their own thing (generally called an "object") as well in VBA, but a Selection is so common and important, it is its own thing (object) in VBA. Any such object in VBA comes with various data called properties and actions called methods that allow us to manipulate them inside Word.

Name ambiguity

Unfortunately, some ambiguity exists in the name. The "Selection" with a capital "S" is a VBA thing (called an "object") that stores information or data (called "properties") as well as possible actions (called "methods") associated with the current selected text (or location) in the document. It is slightly different than the lower-case "selection" which refers to what we users normally think about when saying the word—user selected content in the document. Each active Word document can only have one valid Selection because a user can only edit in one location in the document at a time.

The name ambiguity may be awkward at first, but it actually helps us easily remember the names of the relevant objects when working in VBA.

Get all Selection paragraphs

Paragraphs refers to the collection of all paragraphs included in the Selection. If there is no selection, then "all paragraphs" just means the current one at the insertion point even if it is not selected in the document.

Selection.Paragraphs

Again, we have some ambiguity in the name. The capital "P" Paragraphs is a collection of them in VBA. The lower case "p" version is just a regular paragraph as we normally think about it.

Which paragraph?

First tells Word to pick the first paragraph of the current Paragraphs collection.

Selection.Paragraphs.First

Accessing the first paragraph like this ensures we're working with the entire current paragraph not just part of it regardless of what the user has selected.

Use the paragraph "Range"

Range tells Word to work with the entire paragraph contents (it's a little more complicated, but that is the gist of it). This distinction is a little more confusing when we work with sentences or words later, but for now, we just need to tell VBA we to work with the document Range for the indicated paragraph.

Selection.Paragraphs.First.Range

Why?

Talking about a paragraph implicitly refers to its contents, but we basically cannot delete the paragraph directly because no such action exists for the corresponding Paragraph thingy in VBA. We can only do that through its document Range. We'll talk more about them later but check out our introductory article on Ranges in Word if you can't wait.

Also, as written we could not use the Selection's Delete action with Selection.Delete because it would only delete the contents of the initial selection. We want the entire paragraph deleted. The follow up member article extends the Selection to allow deleting multiple paragraphs.

Delete

Obviously, Delete is the action to take on the paragraph content.

Selection.Paragraphs.First.Range.Delete

References (in the VBA sense)

All of these elements are chained together with periods to let Word know we are successively referencing the previous element for the next part of the command.

Gotcha

It's handy and safer to think about any exceptions when a macro is run on a real-life document, so what could go wrong for this macro?

More than one paragraph selected

What if more than one paragraph is selected by the user when the macro is run?

Uhhh ... well, the macro specifically deletes the first paragraph of the Selection regardless of how big the selection is, so that is exactly what would happen. Any additional content spanned outside the first paragraph would be unchanged. See the member article on a natural extension to conveniently delete multiple paragraphs if you're interested in more.

Final delete paragraph macro (repeated)

Our complete macro is repeated for clarity.

Sub DeleteParagraph()
' Delete the current paragraph without using the clipboard
Selection.Paragraphs.First.Range.Delete
End Sub

I assigned this macro to Command+Shift+Delete in Word for Mac or Control+Shift+Delete in Windows. If you would like even more functionality, see the member articles on deleting or moving multiple paragraphs.

That's it. Now go forth and edit (delete) faster!

Cut version

We could also use the Range's Cut action instead of Delete if we want to put the text on the clipboard for use elsewhere.

Sub CutParagraph()
' Cut the current paragraph to the clipboard
Selection.Paragraphs.First.Range.Cut
End Sub

I assigned this Cut version to Command+Shift+X in Word for Mac or Control+Shift+X on Windows. We could also create a Copy version.

Affiliate Links

If you're interested in using Word or another tool related to the article, check out these affiliate links. I may make a small commission if you purchase when using them, but there is no increase in cost for you, and it helps to support this site and associated content.

I've been using Microsoft for Business for commercial use (that's us writers) on one of the lower pricing tiers for years. I get to use my macros, have online storage, and don't have to worry about software updates.