How to concatenate 2 cells for each cell in a range

gt213

Board Regular
Joined
Jul 5, 2016
Messages
61
I have a worksheet with data in it from Cols A-U and a variable number of rows.

In col V I want to concatenate the data in cells A and E for every row that there is data.

So far I have set a range that is all the cells in col V that I want to concatenate A and E for but I'm not sure how to complete this.

Here is the relevant code I have so far.

With ws1
i = .Range(.Range("A1"), .Range("A1").End(xlDown)).Rows.Count
End With
Set HelperRange = ws1.Range(ws1.Cells(2, 22), ws1.Cells(i, 22))
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Do you want the VBA code to put the formula in column V, or just the resulting value in column V?
 
Upvote 0
Give this a shot and see if it does what you want:
Code:
Sub MyCombine()

    Dim lastRow As Long
    
'   Find lastRow in column A with data
    lastRow = Cells(Rows.Count, "A").End(xlUp).Row
    
'   Populate formula
    Range(Cells(2, "V"), Cells(lastRow, "V")).FormulaR1C1 = "=RC[-21]&RC[-17]"
    Range(Cells(2, "V"), Cells(lastRow, "V")).Value = Range(Cells(2, "V"), Cells(lastRow, "V")).Value
    
End Sub
 
Upvote 0
You are welcome!:)
 
Upvote 0

Forum statistics

Threads
1,217,383
Messages
6,136,264
Members
450,001
Latest member
KWeekley08

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