Concatenate but keep the font format

AnnieNollan

New Member
Joined
Sep 9, 2016
Messages
1
Good day,

I’m trying to concatenate the text from a number of cells. But I want the first cell’s text to be bold.
A1 Class:
B1 Mr. Muller

I want it displayed as:
Class: Mr. Muller

I'm only starting with VBA. And having lot of trouble.

Thanks a lot.
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Assuming your data is in Columns A and B and that you want the output to go to Column C, give this macro a try...
Code:
Sub CombineAandBtoCwithAbold()
  Dim R As Long, LastRow As Long
  LastRow = Cells(Rows.Count, "A").End(xlUp).Row
  For R = 1 To LastRow
    Cells(R, "C").Value = Cells(R, "A").Value & " " & Cells(R, "B").Value
    Cells(R, "C").Characters(1, Len(Cells(R, "A").Value)).Font.Bold = True
  Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,216,028
Messages
6,128,400
Members
449,448
Latest member
Andrew Slatter

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