How to Select an Entire Word with Underscores in Word and Excel
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.

- 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.
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.
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.
Double-click the first part of the word immediately before the underscore to highlight it.
Press and hold the 'Shift' key on your keyboard.
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.

Manually Click and Drag to Highlight
If you prefer using just the mouse, standard dragging allows you to select the exact string without relying on the application's automatic word selection logic.
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. Download WPS Office: Visit the official WPS website and download the free installation package for your operating system.
- 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. Open Your Documents: Launch WPS Writer or WPS Spreadsheets to open, edit, and format your existing Office files with ease.

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.




