ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   iterate my rows (https://www.excelbanter.com/excel-programming/419684-iterate-my-rows.html)

rodchar

iterate my rows
 
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

[email protected]

iterate my rows
 
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

On Nov 7, 3:01*pm, rodchar wrote:
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



rodchar

iterate my rows
 
that work's for me,
thanks for the help.

rod.

" wrote:

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

On Nov 7, 3:01 pm, rodchar wrote:
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





All times are GMT +1. The time now is 02:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com