Macro copy range

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
 
D

Don Guillett

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
 
D

Don Guillett

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top