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

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Jed Shields

Active Member
Joined
Sep 7, 2011
Messages
283
Office Version
  1. 365
Platform
  1. Windows
Aaaaarrrrgggghhhhh!!! Quotes in quotes! It's the only combinination I didn't try! XD
 
Upvote 0

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
81,649
Office Version
  1. 365
Platform
  1. Windows
Glad to help &thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,186,737
Messages
5,959,466
Members
438,426
Latest member
nmk7

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
Top