iterate my rows

R

rodchar

hi all,

let's say i have 2 rows and 2 columns

row1col1 row1col2
row2col1 row2col2

is there a way in a macro or something to iterate each row, taking each
column and adding it to a new single column? so the result would look like
the following

row1col1
row1col2
row2col1
row2col2


thanks,
rodchar
 
J

joshuafandango

Hi Rodchar,

How's this?

Option Explicit
Sub One_Column()
Dim Cell As Range, PasteRange As Range
Set PasteRange = Range("D1")
For Each Cell In Range("A1:B2")
PasteRange = Cell
Set PasteRange = PasteRange.Offset(1, 0)
Next Cell
End Sub

Will copy A1:B2 into column D

Cheers,
JF
 
R

rodchar

that work's for me,
thanks for the help.

rod.

Hi Rodchar,

How's this?

Option Explicit
Sub One_Column()
Dim Cell As Range, PasteRange As Range
Set PasteRange = Range("D1")
For Each Cell In Range("A1:B2")
PasteRange = Cell
Set PasteRange = PasteRange.Offset(1, 0)
Next Cell
End Sub

Will copy A1:B2 into column D

Cheers,
JF
 

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