Merge two columns using excel macro

Closed
new2macros Posts 3 Registration date Tuesday 19 May 2015 Status Member Last seen 19 May 2015 - 19 May 2015 à 12:06
new2macros Posts 3 Registration date Tuesday 19 May 2015 Status Member Last seen 19 May 2015 - 19 May 2015 à 14:50
Hello All
Thank you for taking time to look at my query.

I need to merge two columns in excel file using excel macro.
Below is sample input:
ColA ColB
15.12% $15,120
24.88% $24,880
60% $60,000
I want the two columns to be merged in to a single column:
ColA
(15.12%) $15,120
(24.88%) $24,880
(60%) $60,000

Can someone help me with this?

Thanks a mill.
Related:

1 response

new2macros Posts 3 Registration date Tuesday 19 May 2015 Status Member Last seen 19 May 2015
19 May 2015 à 12:41
Below is the code I used:
Sub Concat()

Dim lRow As Long

lRow = Range("B" & Rows.Count).End(xlUp).Row

For i = 2 To lRow
Cells(i, 13) = "(" & Cells(i, 2) & ")" & " " & Cells(i, 3)
Next i

End Sub

The code works partially. The formatting for the new column needs to be applied. I have no idea of doing that.
I also need to delete the columns A and B.

Can someone please have a look at it?

Thanks
new2macros Posts 3 Registration date Tuesday 19 May 2015 Status Member Last seen 19 May 2015
19 May 2015 à 14:50
Can anyone help me pls?