Macro copy range

  • Thread starter Thread starter canvas
  • Start date Start date
C

canvas

Hi,

I have this data

In column B:

code1
code2
code3

In column C:

city1
city2
city3

How can I create a macro that stores values from B and C column and
pastes them in column A one under the other like:

Column A

code1
code2
code3
city1
city2
city3

Thanks
 
try
sub copybandctoa()
for i=2 to 3
dlr=cells(rows.count,1).end(xlup).row+1
columns(i).copy cells(dlr,1)
next i
end sub
 
use this
Option Explicit

Sub copybandctoa()
Dim i As Long
Dim dlr As Long
Dim slr As Long
For i = 2 To 3
dlr = Cells(Rows.Count, 1).End(xlUp).Row + 1
slr = Cells(Rows.Count, i).End(xlUp).Row
Cells(1, i).Resize(slr).Copy Cells(dlr, 1)
Next i
End Sub
 
Back
Top