How to Fix Excel Cell Underline Extending Beyond Text in WPS Office
Question details
The user wants to stop an underlined Excel cell from showing the underline across the entire cell width instead of only under the text.

- Product
- WPS Office Excel
- Device & OS
- not provided
- Scenario
- While formatting a WPS Office Excel worksheet, the user applies underline to a cell and wants the underline to match the actual text width rather than the cell boundary.
- Observed behavior
- The underline extends to the cell boundary instead of stopping under the characters.
Open the workbook in WPS Office Excel, select the affected cell, and note whether the underline was applied to a specific cell or to an entire row or column. Then open Format Cells to check the current horizontal alignment before making changes.
Change the Horizontal Alignment to General or Left
Use this first when underlined text is using a distributed, justified, or fill alignment that spreads the content across the cell width.
Underline formatting normally follows the displayed characters. When Excel uses a stretched alignment, the underline can visually run to the cell edge even though the underline was applied only to the text. Changing the alignment restores the expected character-width underline.
Select the affected cell or range, right-click it, and choose Format Cells from the context menu.
In the Format Cells dialog, click the Alignment tab, open the Horizontal drop-down list, and select General, Left, or another suitable alignment.
Click OK, then check whether the underline now stops under the text instead of extending to the cell boundary.

Clear Row or Column Formatting and Reapply Underline
Use this when the underline may have been applied to an entire row or column, or when clearing existing formatting is the fastest way to remove the unwanted full-cell underline.
Fix Underline Extending Beyond Text in WPS Office Excel
Use WPS Office Excel to correct cell alignment and clear row or column formatting so underlines appear only under the text. The familiar Excel-style interface makes it easy to update the workbook and save it in Microsoft Excel-compatible format.
- 1. Open the workbook in WPS Office Excel: Launch WPS Office Excel and open the worksheet where the cell underline extends beyond the text.
- 2. Check alignment in Format Cells: Select the affected cell or range, right-click and choose Format Cells, then click the Alignment tab and set Horizontal to General, Left, or Center.
- 3. Clear unwanted formatting if needed: If the underline still extends to the cell boundary, go to the Home tab, click Clear, and select Clear Formats.
- 4. Reapply underline to the text: Select the cell or highlight the text in the formula bar, then press Ctrl+U or click the Underline button on the Home tab.
- 5. Save the workbook: Click Save or press Ctrl+S to keep the corrected formatting.

Frequently Asked Questions
Why does my Excel cell underline extend past the text?
Usually this happens because the horizontal alignment is set to Justify, Distributed, or Fill, or because underline formatting was applied to an entire row or column. Open Format Cells, go to the Alignment tab, and set Horizontal to General, Left, or Center.
How do I remove underline from only part of a cell?
Select the cell, click in the formula bar, highlight the specific characters, and then click Underline or press Ctrl+U. To remove underline from an entire row or column, select that row or column and clear formatting.
Does WPS Office Excel support the same underline formatting as Microsoft Excel?
Yes. WPS Office Excel supports common text formatting, including underline, and can open and edit .xlsx and .xls files with Microsoft Excel-compatible formatting.
How do I clear formatting from a whole row or column in WPS Excel?
Select the row or column, go to the Home tab, click Clear, and choose Clear Formats. Then reapply underline only to the intended cells.
Can I use a keyboard shortcut to underline text in WPS Office Excel?
Yes. Select the cell or highlight the text in the formula bar and press Ctrl+U.




