Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problems with Transposing. HELP!

I have 70 rows that is 11 columns deep that I need to put into one long
column using a macro. I want the rows to be consecutively loaded. A
smaller version of what I'm trying to do is this:

Turn this:
1 2 3
4 5 6
7 8 9

Into this:
1
2
3
4
5
6
7
8
9

This needs to be a macro because I receive this data once a day in the
incorrect format. Any advice you have would be appreciated!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Problems with Transposing. HELP!

Sub test()

Dim r As Long
Dim c As Long
Dim n As Long
Dim arr1
Dim arr2(1 To 770, 1 To 1)

arr1 = Range(Cells(1), Cells(70, 11))

For r = 1 To 70
For c = 1 To 11
n = n + 1
arr2(n, 1) = arr1(r, c)
Next
Next

Range(Cells(1), Cells(770, 1)) = arr2

End Sub


RBS


wrote in message
oups.com...
I have 70 rows that is 11 columns deep that I need to put into one long
column using a macro. I want the rows to be consecutively loaded. A
smaller version of what I'm trying to do is this:

Turn this:
1 2 3
4 5 6
7 8 9

Into this:
1
2
3
4
5
6
7
8
9

This needs to be a macro because I receive this data once a day in the
incorrect format. Any advice you have would be appreciated!


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default Problems with Transposing. HELP!

Select your data matrix and give a range name, e.g. myRange. Then give
the cell where your column will start a range name, e.g. "anchor".
Then use this code:

Sub BuildColumn()
Dim cell As Range, i As Integer

i = 1
For Each cell In Range("myRange")
Range("anchor").Cells(i) = cell
i = i + 1
Next

End Sub

wrote:
I have 70 rows that is 11 columns deep that I need to put into one long
column using a macro. I want the rows to be consecutively loaded. A
smaller version of what I'm trying to do is this:

Turn this:
1 2 3
4 5 6
7 8 9

Into this:
1
2
3
4
5
6
7
8
9

This needs to be a macro because I receive this data once a day in the
incorrect format. Any advice you have would be appreciated!


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problems with Transposing. HELP!


Try this:

Sub Test()
Dim i As Integer
Dim j As Integer
Dim k As Integer

i = 0
k = 1
Do While i < 70
j = 0
Do While j < 11
Range("D" & k) = Range("A1").Offset(i, j)
j = j + 1
k = k + 1
Loop
i = i + 1
Loop

End Sub

Assuming A1 is your starting point and D is your long column

--
renega
-----------------------------------------------------------------------
renegan's Profile: http://www.excelforum.com/member.php...fo&userid=1045
View this thread: http://www.excelforum.com/showthread.php?threadid=55247

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
Transposing Brian86 Excel Discussion (Misc queries) 3 January 7th 09 05:00 PM
need help with transposing [email protected] Excel Discussion (Misc queries) 2 October 30th 08 02:10 PM
Transposing Nanapat Excel Discussion (Misc queries) 2 April 2nd 08 11:38 PM
Transposing Deena Excel Worksheet Functions 2 October 27th 06 05:13 PM
TRANSPOSING GARY Excel Discussion (Misc queries) 1 March 17th 06 11:09 AM


All times are GMT +1. The time now is 12:16 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"