Need help adding CONCATENATE formula to cell using VBA

Jed Shields

Active Member
Joined
Sep 7, 2011
Messages
283
Office Version
  1. 365
Platform
  1. Windows
Hello all,

I'm trying to add a formula that adds the first and last names to a cell. It works fine but I'm having trouble adding a space between the names. Any ideas on the correct syntax?


Code:
Sub FullName()

Dim LastRow As Long
 LastRow = Range("AJ" & Rows.Count).End(xlUp).Row
Range("BH1").Select
    ActiveCell.FormulaR1C1 = "Full Name"
Range("BH2").Select
    ActiveCell.Formula = "=concatenate(C2&""&D2)"
'Range("BH2").Select
'    Selection.AutoFill Destination:=Range("BH2:BH" & LastRow)
Range("BH2").AutoFill Destination:=Range("BH2:BH" & LastRow)
End Sub

Cheers,

Jed
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Aaaaarrrrgggghhhhh!!! Quotes in quotes! It's the only combinination I didn't try! XD
 
Upvote 0
Glad to help &thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,267
Members
449,075
Latest member
staticfluids

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