KutoolsforOffice — One Suite. Five Tools. Get More Done.February Sale: 20% Off

How to bold only the first line or first word in a cell in Excel?

AuthorSiluviaLast modified

When working with Excel spreadsheets, it's often necessary to enhance readability or draw attention to key parts of your text within cells. For instance, in databases, reports, or presentation sheets, you might want to bold just the first line of a long comment or the initial word of a paragraph in a cell. Doing so can make your data more organized and easier to interpret, especially when sharing with others or during presentations. However, Excel doesn’t provide a straightforward built-in feature to bold only certain parts—such as the first line or first word—within a cell. This article introduces several practical methods for achieving this, ranging from VBA solutions for more advanced users to simple, efficient tools suitable for those with minimal programming experience. You’ll learn how to apply partial formatting in cells according to your needs and workflow.

Bold only the first line in a cell using VBA code

Bold only the first word in a cell using VBA code

Bold only the first word or first line in a cell using Kutools AI


Bold only the first line in a cell using VBA code

Excel does not offer a built-in feature to directly format only the first line of text within a cell. If you often work with multi-line text (using Alt+Enter for line breaks), highlighting only the first line can help differentiate headers, explanations, or comment titles from the remainder of the content. Using VBA is a practical way to automate this formatting task, especially for large volumes of data.

Before you begin, ensure your data is formatted with clear line breaks. For best results, avoid using formulas in these cells, as partial bold formatting works directly with text content.

1. Press the Alt + F11 keys at the same time to launch the Microsoft Visual Basic for Applications window. This step allows you to access Excel’s VBA environment, where you can enter and modify automation scripts.

2. In the VBA editor window, click on Insert > Module. Then, copy and paste the following VBA code into the newly created Module pane.

VBA code: Bold only the first line in cells

Option Explicit
Sub BoldFirstLine()
Dim xRng As Range, xCell As Range
Dim xFirstRow As String
On Error Resume Next
Set xRng = Application.InputBox("Please select range:", "Kutools for", Selection.Address, , , , , 8)
If xRng Is Nothing Then Exit Sub
On Error Resume Next
For Each xCell In xRng
    With xCell
        .Characters(1, InStr(.Value, Chr(10))).Font.Bold = True
    End With
Next
End Sub

3. After pasting the code, press F5 to run it. You’ll see a "Kutools for Excel" dialog box prompting you to select the cell range where you want just the first line to be bold. Carefully select the range, making sure that you do not include cells with formulas or non-text content to prevent unexpected results. Click OK to execute.

vba code to select the data range

The VBA script will instantly apply bold formatting to only the first line in each selected cell, leaving subsequent lines unchanged. See the following screenshot for confirmation:

all first lines of selected cells are bold

Tips and Troubleshooting: If the macro does not seem to work, check that your cells contain line breaks created by using Alt + Enter and that you are not running the code on merged cells, which can cause errors. For best results, restrict the range to plain text cells. If you encounter a permissions prompt, enable macros as required by your Excel security settings.


Bold only the first word in a cell using VBA code

In certain cases, such as highlighting names, keywords, or leading terms in product descriptions, you may wish to bold only the first word of text in each Excel cell, leaving the rest in regular font. This not only improves clarity but also enhances the look of lists or logs. The following VBA approach is flexible and suitable for batch-processing multiple cells at once.

1. Open the Microsoft Visual Basic for Applications editor by pressing Alt + F11 simultaneously.

2. In the VBA editor, click Insert > Module, and then input the VBA code provided below into the Module window.

VBA code: Bold only the first word in cells

Sub boldtext()
Dim xRng As Range, xCell As Range
On Error Resume Next
Set xRng = Application.InputBox("Please select range:", "Kutools fro Excel", Selection.Address, , , , , 8)
If xRng Is Nothing Then Exit Sub
On Error Resume Next
For Each xCell In xRng
  If xCell.Value <> "" Then
    xCell.Characters(1, InStr(1, xCell.Value, " ") - 1).Font.Bold = True
  End If
Next
End Sub

3. Run the macro by pressing F5. When the "Kutools for Excel" dialog appears, specify the cell range where you want the first word bolded, and then click OK. Selecting non-text cells won't have any effect, and it's best to ensure that the range you choose is filled with plain or wrapped text for consistent results.

vba code to select the data range

After the macro completes, you’ll notice that in each selected cell, only the first word is bold. The following example illustrates the visual result:

all first words of selected cells are bold

Tips and Precautions: The macro treats words separated by space as independent words, so make sure there are no leading spaces that would result in an empty "first" word. Avoid applying to cells containing formulas, and always save your work before running VBA macros to prevent data loss in case of errors.


Bold only the first word or first line in a cell using Kutools AI

If the VBA method feels overwhelming or you prefer a more straightforward tool without coding, the "Kutools AI" feature in Kutools for Excel provides a user-friendly, time-saving solution. This approach is ideal for those who regularly need to apply specific bold formatting rules across extensive worksheets or have varying requirements for text highlighting.

Kutools for Excel offers over 300 advanced features to streamline complex tasks, boosting creativity and efficiency. Itegarate with AI capabilities, Kutools automates tasks with precision, making data management effortless. Detailed information of Kutools for Excel...         Free trial...

To get started, make sure you have Kutools for Excel installed. Click the Kutools tab, then select AI Aide to open the "Kutools AI Aide" panel in your Excel interface.

  1. Highlight the range of cells containing the text you want to partially bold. This solution works especially well for processing content with consistent structures, such as comments, feedback summaries, or data labels.
  2. In the chat box, enter your formatting requirement, such as:
    ● Bold first word of each cell:
    Bold only the first word in the selected range.
    ● Bold first line of each cell
    Bold only the first line in each cell within the selected range.
  3. Next, press the Enter key or click the Send button. Kutools AI will process your request, analyze the cell content, and upon completion, prompt you to click Execute to apply changes.

This method is particularly advantageous for users who do not want to deal with VBA or repetitive manual formatting. In addition, Kutools AI supports other custom formatting commands and can handle large datasets efficiently. If the AI result does not match expectations, you can rephrase the command or check if your Excel sheet contains merged or formatted cells that might affect execution.

Bolding the first line or the first word in Excel cells to enhance both the visual structure and the accessibility of your information. Consider your sheet layout and content type to choose the method that fits your scenario—whether quickly automating via VBA or leveraging the flexibility and intelligence of Kutools AI. Taking these steps will help your key data stand out and improve readability across your Excel projects.

If you're interested in discovering more advanced or creative Excel formatting techniques, explore our comprehensive library of Excel tutorials for further inspiration.


Related article:


Alternative method: For small datasets or when you only need to apply bold formatting to a limited number of cells, you can use manual editing as an alternative. Double-click on the target cell to enter edit mode, use your mouse or arrow keys to highlight the first word or first line, then apply bold formatting by pressing Ctrl+B or clicking the B (bold) icon in the Excel toolbar. While practical for very limited data, this method is time-consuming and not suitable for large or frequently changing ranges.

In practice, always ensure your Excel settings allow macros if using VBA, and consider saving a backup of your worksheet before applying automation to prevent unexpected formatting changes. When using Kutools, make sure the add-in is up-to-date to access the newest features. If partial formatting does not appear as expected, verify that cell content is plain text, not a formula, and that the font supports bold styling.

Best Office Productivity Tools

🤖Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |  Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |  Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!

All Kutools add-ins. One installer

Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.

ExcelWordOutlookTabsPowerPoint
  • All-in-one suite — Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
  • One installer, one license — set up in minutes (MSI-ready)
  • Works better together — streamlined productivity across Office apps
  • 30-day full-featured trial — no registration, no credit card
  • Best value — save vs buying individual add-in