Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Iterate rows of spreadsheet(s}\Get values gh Excel Programming 1 May 8th 08 03:18 PM
Iterate rows, add like values - an easier way? Ed from AZ Excel Programming 1 April 3rd 08 06:09 PM
Iterate Thru Cells Kelvin Excel Programming 4 September 5th 07 10:18 AM
Can't iterate thru a row with For peter Excel Programming 2 January 7th 05 04:46 AM
Iterate columns wired Excel Programming 9 November 14th 03 11:14 PM


All times are GMT +1. The time now is 10:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"