Bold one word in a cell not the entire cell

ielamrani

Board Regular
Joined
Jun 2, 2008
Messages
63
Hi,
This piece of code bold the entire cell, I am trying to make it bold only the words: Owner and Beneficiary. I tried different ways in vain. Please let me know if you know the answer. Thanks in advance.

Code:

RptWks.Cells(oRow,"A").Value _
= "Owner: " & .Cells(iRow, "A").Value

RptWks.Cells(oRow,"A").Font.Bold = True

oRow = oRow + 1
RptWks.Cells(oRow,"A").Value _
= "Beneficiary: " & .Cells(iRow, "B").Value

RptWks.Cells(oRow,"A").Font.Bold = True
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
try
Code:
With RptWks.Cells(oRow,"A")
    .Font.Bold = False
    .Value = "Owner: " & .Cells(iRow, "A").Value
    .Characters(1, 5).Font.Bold = True
End With
 
oRow = oRow + 1
With RptWks.Cells(oRow,"A")
    .Font.Bold = False
    .Value = "Beneficiary: " & .Cells(iRow, "B").Value
    .Characters(1, 11).Font.Bold = True
End With
 
Upvote 0
Try this:

RptWks.Cells(oRow, "A").Value _
= "Owner: " & .Cells(iRow, "A").Value

RptWks.Cells(oRow, "A").Characters(Start:=1, Length:=11).Font.FontStyle = "Bold"

oRow = oRow + 1
RptWks.Cells(oRow, "A").Value _
= "Beneficiary: " & .Cells(iRow, "B").Value

RptWks.Cells(oRow, "A").Characters(Start:=1, Length:=11).font.FontStyle = "Bold"
 
Upvote 0
Hi guys,
I tried both.
Jindon, your code does not like the word Characters. It highlights it.

Bbornemeier,

Yours works with a slight change instead of 11 for Owner it's 5. I am sure it's a typo.

RptWks.Cells(oRow, "A").Characters(Start:=1, Length:=5).Font.FontStyle = "Bold"

Thank you so much guys.
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,731
Members
448,987
Latest member
marion_davis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top