Concatenate and Bold two columns

loisl

New Member
Joined
Feb 8, 2019
Messages
3
This is so stupid but I have been googling for ages and still can't figure out how I've done this before so I'm hoping someone can help!

I have two columns - A and B. I want to join A to B into column C, but keep the format of column A bold. I'm sure the macro for this is straightforward but I honestly can't remember it. Can anyone help? Thanks!
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Hello and welcome.

Wasn't sure which columns you wanted bold but that is easy enough. This code will need altering to suit your data. Make sure to test on a COPY...:D

Code:
Sub ConcatenateColumns()


    'assuming data starts on row 1


    Dim lr As Long 'last row in column a & b (used for both)
    Dim nr As Long 'next blank row in column c
    
    
    'last row in col A
    lr = Range("A" & Rows.Count).End(xlUp).Row
    
    'copy column A to start of column C.
    Range("A1:A" & lr).Copy Range("C1")
    
    'last row in col B
    lr = Range("B" & Rows.Count).End(xlUp).Row
    
    'last row in col c
    nr = Range("C" & Rows.Count).End(xlUp).Row + 1
    
    'copy column A to start of column C
    Range("B1:B" & lr).Copy Range("C" & nr)
    
    'To set a column to Bold:
    Range("C1").EntireColumn.Font.Bold = True
    
    
End Sub
 
Upvote 0
If I understand correctly, you want the text in column C which came from column A to be bold.
Try this:
Code:
    With Range("C1")        .Value = .Offset(0, -2).Value & " " & .Offset(0, -1).Value
        .Characters(Start:=1, Length:=Len(.Offset(0, -2).Value)).Font.FontStyle = "Bold"
    End With
I will leave to you to sort out the ranges and the loops :)
 
Upvote 0
Thanks, I think I didn't explain this very well! I have
A1: John Smith B1: Organisation

and want to make

A1: John Smith B1: Organisation C1: John Smith Organisation

I managed to do it yesterday but only for row A, and have now lost the code I used. Going swimmingly!
 
Upvote 0
I've done it in HTML so we can all stand down! Thanks for the suggestions, I will endeavour to improve my skills so I don't cheat next time!
 
Upvote 0

Forum statistics

Threads
1,222,195
Messages
6,164,510
Members
451,900
Latest member
lamski

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