logo
search
Document Editing Problems

How to Select an Entire Word with Underscores in Word and Excel

Guest WriterGuest Writer Oct 10, 2026 869 views

Question details

The user needs to select complete text strings that contain underscores (such as file names or code variables) using a quick selection method like double-clicking.

How to Select an Entire Word Containing an Underscore in Word and Excel
Product
Microsoft Word and Excel
Device & OS
not provided
Scenario
Editing documents or spreadsheets containing underscore characters and attempting to highlight the full string quickly without manually dragging the cursor.
Observed behavior
Double-clicking text with an underscore only selects the characters up to the underscore because the application treats underscores as word delimiters, and automatic selection options do not override this behavior.
Before you start

Understand that Microsoft Office has hardcoded underscores as word delimiters by design, meaning no built-in settings menu will allow you to change the default double-click selection boundary.

Solution 1Recommended

Use the Shift-Click Method to Extend the Selection

Since double-clicking is limited by Microsoft's design rules, you can use a quick keyboard and mouse combination to efficiently select the rest of the underscore-delimited word.

This method is the most efficient built-in workaround for highlighting text strings separated by delimiters like underscores, hyphens, or periods without relying purely on a steady hand to drag the cursor.

1
Select the first portion

Double-click the first part of the word immediately before the underscore to highlight it.

2
Hold the Shift key

Press and hold the 'Shift' key on your keyboard.

3
Extend the text selection

While holding Shift, click at the very end of the text string. This forces the application to extend your highlight across the underscore to the end of the word.

Use the Shift-Click Method to Extend the Selection
Intended Application Behavior: Microsoft has confirmed this is intended behavior. Changing the 'Automatic word selection' setting under Advanced Options will not override these delimiter rules.
Free Microsoft Office alternative

Try WPS Office for Seamless Document Editing

While text selection delimiters are standard across many word processors and cannot be easily changed in MS Office, WPS Office offers a lightweight, highly compatible, and user-friendly alternative to Microsoft Office. It's completely free and handles all your standard document needs efficiently.

  1. 1. Download WPS Office: Visit the official WPS website and download the free installation package for your operating system.
  2. 2. Install the Suite: Run the installer and follow the quick on-screen instructions to set up the WPS Office suite on your device.
  3. 3. Open Your Documents: Launch WPS Writer or WPS Spreadsheets to open, edit, and format your existing Office files with ease.
Fully compatible with Microsoft Word (.docx) and Excel (.xlsx) file formats.Familiar user interface makes transitioning easy and minimizes document editing problems.Lightweight installation with fast document loading and processing speeds.Built-in PDF editing tools seamlessly combined with powerful word processing and spreadsheets.
QA img-9

Frequently Asked Questions

Can I change the delimiter settings in Microsoft Word or Excel?

No, Microsoft Word and Excel have hardcoded word delimiters, which include underscores, hyphens, and periods. There is no built-in interface setting or option to remove the underscore from the system's delimiter list.

Does turning off 'Select entire word automatically' fix this issue?

No. Disabling the 'When selecting, automatically select entire word' option in the Advanced Options menu only affects the click-and-drag behavior. It does not alter where the boundary stops when double-clicking a word.

Is there a macro to select underscore-separated words automatically?

Advanced users can write a VBA macro that expands the current cursor selection to include adjacent characters until a white space is found, and then assign this macro to a custom keyboard shortcut. However, this will still not change the default double-click mouse behavior.