Macro to Concatenate 2 column and copy the same upto last row (where data is available )

gssachin

Board Regular
Joined
Nov 14, 2013
Messages
155
Hi

I have to concatenate 2 column i.e. d2 & e2 (d2&"."&e2) and same has to be copy upto last row as per F column. I write following macro but its taking 2 much time to execute. Can anybody tell faster way ???

sub macro 1
lastRow = Sheet1.Range("F" & Rows.Count).End(xlUp).Row
For i = 2 To lastRow
Cells(i, 7) = (Cells(i, 4) & "." & Cells(i, 5))
Next i
end sub
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
hi,

I would include a column of dots in your data before starting - this only takes a second and will make the formula easier. So in my case, I added the
dots in column C, but you could add them into G or where ever you like. Becuase I added into column C, the forumla includes RC[-3]. Adjust this part
depending on the column (if dots were in column G it would read RC[1]

Macro code is :-
Sub macro1()
Dim lastrow As Integer
Dim i As Integer
Dim sheet6 As Worksheet


lastrow = Cells(Rows.Count, 4).End(xlUp).Row
For i = 1 To lastrow
Cells(i, 6) = "=CONCATENATE(RC[-2],RC[-3],RC[-1])"
Next i


End Sub


That work ??
 
Upvote 0

Forum statistics

Threads
1,213,514
Messages
6,114,078
Members
448,547
Latest member
arndtea

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