David Klempfner
David Klempfner

Reputation: 9870

VBA Concatenate 2 Columns

How can I concatenate columns A and B to create column C?

A    B  
abc  jkl 
def  mno 
ghi  pqr 

Column C should be this:

C
abc
def
ghi
jkl
mno
pqr

Upvotes: 0

Views: 176

Answers (1)

Sathish Kothandam
Sathish Kothandam

Reputation: 1520

Is that what you are looking for

Sub testing()
Dim lrow1 As Long
Dim lrow2 As Long

With ActiveSheet
lrow1 = .Range("A" & Rows.Count).End(xlUp).Row
lrow2 = .Range("B" & Rows.Count).End(xlUp).Row

.Range("A1:A" & lrow1).Copy .Range("C1")
.Range("B1:B" & lrow2).Copy .Range("C" & lrow1 + 1)

End With

End Sub

i run this macro .got the below result

enter image description here

Upvotes: 1

Related Questions