ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   transpose rows to column (cell) (https://www.excelbanter.com/excel-discussion-misc-queries/252299-transpose-rows-column-cell.html)

Ghaleb Bakri

transpose rows to column (cell)
 
Hello,

I have the below table:

A B C D E F G H I J K L
x y z 1 2 3 4 5 6 7 8 9
c b d 2 3 4 5 6 7 8 9 2

I need to transpose as follows:

X y z 1
x y z 2
X y z 3
x y z 4
x y z 5
x y z 6
x y z 7
x y z 8
x y z 9
c b d 2
c b d 3

....etc

I really apprecite if a help can be sent to me

Thx
Ghaleb



Submitted via EggHeadCafe - Software Developer Portal of Choice
Word HTML Cleaner
http://www.eggheadcafe.com/tutorials...l-cleaner.aspx

Gary Keramidas

transpose rows to column (cell)
 
are they supposed to be all in column A or in columns A-D?


--


Gary Keramidas
Excel 2003


"Ghaleb Bakri" wrote in message ...
Hello,

I have the below table:

A B C D E F G H I J K L
x y z 1 2 3 4 5 6 7 8 9
c b d 2 3 4 5 6 7 8 9 2

I need to transpose as follows:

X y z 1
x y z 2
X y z 3
x y z 4
x y z 5
x y z 6
x y z 7
x y z 8
x y z 9
c b d 2
c b d 3

...etc

I really apprecite if a help can be sent to me

Thx
Ghaleb



Submitted via EggHeadCafe - Software Developer Portal of Choice
Word HTML Cleaner
http://www.eggheadcafe.com/tutorials...l-cleaner.aspx



Gary Keramidas

transpose rows to column (cell)
 
you can give this code a try, it puts the results on a separate sheet. didn't
have a lot of time to test it.

Sub test()
Dim ws As Worksheet
Dim ws2 As Worksheet
Dim lastrow As Long
Dim lastcol As Long
Dim i As Long
Dim y As Long
Dim z As Long

y = 1
Set ws = Worksheets("sheet1")
Set ws2 = Worksheets("sheet2")
lastrow = ws.Cells(Rows.Count, "A").End(xlUp).Row
lastcol = ws.Cells(1, Columns.Count).End(xlToLeft).Column
ws2.Cells.Clear
With ws
For i = 1 To lastrow
For z = 4 To lastcol
ws2.Range("A" & y & ":C" & y).Value = ws.Range("A" & i &
":C" & i).Value
ws2.Cells(y, 4).Value = ws.Cells(i, z).Value
y = y + 1
Next
Next
End With
End Sub


--


Gary Keramidas
Excel 2003


"Ghaleb Bakri" wrote in message ...
Hello,

I have the below table:

A B C D E F G H I J K L
x y z 1 2 3 4 5 6 7 8 9
c b d 2 3 4 5 6 7 8 9 2

I need to transpose as follows:

X y z 1
x y z 2
X y z 3
x y z 4
x y z 5
x y z 6
x y z 7
x y z 8
x y z 9
c b d 2
c b d 3

...etc

I really apprecite if a help can be sent to me

Thx
Ghaleb



Submitted via EggHeadCafe - Software Developer Portal of Choice
Word HTML Cleaner
http://www.eggheadcafe.com/tutorials...l-cleaner.aspx



מיכאל (מיקי) אבידן

transpose rows to column (cell)
 
The green range was named "DATA".
Assuming you want the results in 4 columns [A<--D] - try this:
http://img85.imageshack.us/img85/5950/nonameqx.png
Micky


"Ghaleb Bakri" wrote:

Hello,

I have the below table:

A B C D E F G H I J K L
x y z 1 2 3 4 5 6 7 8 9
c b d 2 3 4 5 6 7 8 9 2

I need to transpose as follows:

X y z 1
x y z 2
X y z 3
x y z 4
x y z 5
x y z 6
x y z 7
x y z 8
x y z 9
c b d 2
c b d 3

....etc

I really apprecite if a help can be sent to me

Thx
Ghaleb



Submitted via EggHeadCafe - Software Developer Portal of Choice
Word HTML Cleaner
http://www.eggheadcafe.com/tutorials...l-cleaner.aspx
.



All times are GMT +1. The time now is 03:27 PM.

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