Formatting rule that will automatically bold the first word only in a cell.

Anonymous
2019-09-08T07:22:40+00:00

Hello,

I need to create a list in excel where the first word in the cell is bold but the second word is not. Is there a shortcut to doing this manually for every cell?

See below example:

I want to be able to replicate the formatting for column C without having to do this for each name as I have 500+ names in the list. 

Can anyone help with a work around for this? 

Many thanks!

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Andreas Killer 144K Reputation points Volunteer Moderator
    2019-09-08T09:31:36+00:00

    Right-click on the sheet tab

    Choose "View Code"

    Within the menu click Insert \ Module

    Paste in the code below

    Close the VBA editor

    Press Alt-F8

    Choose the macro

    Click Run

    If that doesn't work check your security settings as described here:

    Enable or disable macros in Office files - Office Support

    Note: The macro removes any formulas in column C, because it is only possible to format a part of a cell if it contains a value.

    Andreas.

    Sub BoldName()

      Dim Where As Range, This As Range

      Dim i As Long

      Set Where = Range("C1", Range("C" & Rows.Count).End(xlUp))

      With Where

        .Value = .Value

        .Font.Bold = False

      End With

      For Each This In Where

        i = InStr(This, ",")

        If i = 0 Then i = Len(This) + 1

        This.Characters(1, i - 1).Font.Bold = True

      Next

    End Sub

    5 people found this answer helpful.
    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Andreas Killer 144K Reputation points Volunteer Moderator
    2019-09-08T07:32:13+00:00

    That is not possible with a conditional formatting, you must run a macro.

    Do you want to include the comma to be bold or only the name?

    Andreas.

    0 comments No comments
  2. Anonymous
    2019-09-08T09:14:51+00:00

    Hi Andreas,

    Thank you for your response. The comma can be bold but bot fussed if it makes a difference. Could you tell me how to run a macro? 

    Thanks again,

    Kate

    0 comments No comments
  3. Anonymous
    2019-09-09T03:25:21+00:00

    Amazing!!! It worked. Thank you so so much! 

    Really appreciate it. 

    Best regards

    Kate

    0 comments No comments