transpose

vaas

New Member
Joined
Dec 29, 2009
Messages
11
I need to do the transpose on excel...pls help me on this

the data in the row should be appended in the column of the next sheet

Code:
<table style="border-collapse: collapse; width: 2640pt;" border="0" cellpadding="0" cellspacing="0" width="3516"><tbody><tr style="height: 15pt;" height="20"></tr><tr style="height: 15pt;" height="20"><td style="height: 15pt; width: 48pt;" width="64" height="20"> 


</td><td style="width: 48pt;" width="64"> 
</td><td class="xl63" style="width: 72pt;" align="right" width="96">12/31/2008</td><td class="xl63" style="width: 55pt;" align="right" width="73">1/7/2009</td><td class="xl63" style="width: 55pt;" align="right" width="73">1/14/2009</td><td class="xl63" style="width: 52pt;" align="right" width="69">1/21/2009</td><td class="xl63" style="width: 60pt;" align="right" width="80">1/28/2009</td><td class="xl63" style="width: 63pt;" align="right" width="84">2/4/2009</td><td class="xl63" style="width: 52pt;" align="right" width="69">2/11/2009</td><td class="xl63" style="width: 52pt;" align="right" width="69">2/18/2009</td><td class="xl63" style="width: 53pt;" align="right" width="70">2/25/2009</td><td class="xl63" style="width: 48pt;" align="right" width="64">3/4/2009</td><td class="xl63" style="width: 52pt;" align="right" width="69">3/11/2009</td><td class="xl63" style="width: 51pt;" align="right" width="68">3/18/2009</td><td class="xl63" style="width: 62pt;" align="right" width="83">3/25/2009</td><td class="xl63" style="width: 48pt;" align="right" width="64">4/1/2009</td><td class="xl63" style="width: 48pt;" align="right" width="64">4/8/2009</td><td class="xl63" style="width: 52pt;" align="right" width="69">4/15/2009</td><td class="xl63" style="width: 54pt;" align="right" width="72">4/22/2009</td><td class="xl63" style="width: 52pt;" align="right" width="69">4/29/2009</td><td class="xl63" style="width: 48pt;" align="right" width="64">5/2/2009</td><td class="xl63" style="width: 52pt;" align="right" width="69">5/13/2009</td><td class="xl63" style="width: 55pt;" align="right" width="73">5/20/2009</td><td class="xl63" style="width: 52pt;" align="right" width="69">5/27/2009</td><td class="xl63" style="width: 48pt;" align="right" width="64">6/3/2009</td><td class="xl63" style="width: 51pt;" align="right" width="68">6/10/2009</td><td class="xl63" style="width: 61pt;" align="right" width="81">6/17/2009</td><td class="xl63" style="width: 51pt;" align="right" width="68">6/24/2009</td><td class="xl63" style="width: 48pt;" align="right" width="64">7/1/2009</td><td class="xl63" style="width: 48pt;" align="right" width="64">7/8/2009</td><td class="xl63" style="width: 53pt;" align="right" width="70">7/15/2009</td><td class="xl63" style="width: 50pt;" align="right" width="66">7/22/2009</td><td class="xl63" style="width: 52pt;" align="right" width="69">7/29/2009</td><td class="xl63" style="width: 48pt;" align="right" width="64">8/5/2009</td><td class="xl63" style="width: 55pt;" align="right" width="73">8/12/2009</td><td class="xl63" style="width: 55pt;" align="right" width="73">8/19/2009</td><td class="xl63" style="width: 50pt;" align="right" width="67">8/26/2009</td><td class="xl63" style="width: 48pt;" align="right" width="64">9/2/2009</td><td class="xl63" style="width: 48pt;" align="right" width="64">9/9/2009</td><td class="xl63" style="width: 51pt;" align="right" width="68">9/16/2009</td><td class="xl63" style="width: 50pt;" align="right" width="67">9/23/3009</td><td class="xl63" style="width: 51pt;" align="right" width="68">9/30/2009</td><td class="xl63" style="width: 51pt;" align="right" width="68">10/7/2009</td><td class="xl63" style="width: 56pt;" align="right" width="75">10/14/2009</td><td class="xl63" style="width: 56pt;" align="right" width="75">10/21/2009</td><td class="xl63" style="width: 56pt;" align="right" width="75">10/28/2009</td><td class="xl63" style="width: 51pt;" align="right" width="68">11/4/2009</td><td class="xl63" style="width: 56pt;" align="right" width="75">11/11/2009</td><td class="xl63" style="width: 56pt;" align="right" width="75">11/18/2009</td><td class="xl63" style="width: 56pt;" align="right" width="75">11/25/2009</td></tr><tr style="height: 15pt;" height="20"><td style="height: 15pt;" align="right" height="20">239674</td><td align="right">3296715</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">0</td><td align="right">1</td><td align="right">1</td><td align="right">1</td><td align="right">1</td></tr><tr style="height: 15pt;" height="20"><td style="height: 15pt;" align="right" height="20">111111</td><td align="right">9999999</td><td align="right">4</td><td align="right">4</td><td align="right">4</td><td align="right">4</td><td align="right">6</td><td align="right">6</td><td align="right">6</td><td align="right">6</td><td align="right">11</td><td align="right">11</td><td align="right">11</td><td align="right">11</td><td align="right">13</td><td align="right">13</td><td align="right">13</td><td align="right">13</td><td align="right">14</td><td align="right">14</td><td align="right">14</td><td align="right">14</td><td align="right">11</td><td align="right">11</td><td align="right">11</td><td align="right">11</td><td align="right">12</td><td align="right">12</td><td align="right">12</td><td align="right">12</td><td align="right">12</td><td align="right">12</td><td align="right">12</td><td align="right">12</td><td align="right">6</td><td align="right">6</td><td align="right">6</td><td align="right">6</td><td align="right">5</td><td align="right">5</td><td align="right">5</td><td align="right">5</td><td align="right">9</td><td align="right">9</td><td align="right">9</td><td align="right">9</td><td align="right">3</td><td align="right">3</td><td align="right">3</td><td align="right">3</td></tr></tbody></table>
I m trying to automate to get the below o/p from these two rows

Code:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             <table style="border-collapse: collapse; width: 200pt;" border="0" cellpadding="0" cellspacing="0" width="267"><col style="width: 48pt;" width="64" span="2"> <col style="width: 56pt;" width="75"> <col style="width: 48pt;" width="64"> <tbody><tr style="height: 15pt;" height="20"> <td style="height: 15pt; width: 48pt;" align="right" width="64" height="20">239674</td> <td style="width: 48pt;" align="right" width="64">3296715</td> <td class="xl63" style="width: 56pt;" align="right" width="75">12/31/2008</td> <td style="width: 48pt;" align="right" width="64">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">1/7/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">1/14/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">1/21/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">1/28/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">2/4/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">2/11/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">2/18/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">2/25/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">3/4/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">3/11/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">3/18/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">3/25/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">4/1/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">4/8/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">4/15/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">4/22/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">4/29/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">5/2/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">5/13/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">5/20/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">5/27/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">6/3/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">6/10/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">6/17/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">6/24/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">7/1/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">7/8/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">7/15/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">7/22/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">7/29/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">8/5/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">8/12/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">8/19/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">8/26/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">9/2/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">9/9/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">9/16/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">9/23/3009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">9/30/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">10/7/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">10/14/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">10/21/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">10/28/2009</td> <td align="right">0</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">11/4/2009</td> <td align="right">1</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">11/11/2009</td> <td align="right">1</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">11/18/2009</td> <td align="right">1</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">239674</td> <td align="right">3296715</td> <td class="xl63" align="right">11/25/2009</td> <td align="right">1</td> </tr> </tbody></table>
< Next Row like this will append here >
tried to write the code for this and last time..when i ran it worked..and now, it is not working...can you pls help me on this

Code:
Sub Macro4()
'
' Macro4 Macro
'
RunningTotalRows = 0
'
For RowCount = 2 To 3
    For ColCount = 3 To 50
        RunningTotalRows = RunningTotalRows + 1
        Sheets("Sheet3").Cells(RunningTotalRows, 1).Value = Sheets("ABC").Cells(RowCount, 1).Value
        Sheets("Sheet3").Cells(RunningTotalRows, 2).Value = Sheets("ABC").Cells(RowCount, 2).Value
        Sheets("Sheet3").Cells(RunningTotalRows, 3).Value = Sheets("ABC").Cells(1, ColCount).Value
        Sheets("Sheet3").Cells(RunningTotalRows, 4).Value = Sheets("ABC").Cells(RowCount, ColCount).Value
    Next ColCount
Next RowCount
End Sub
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Try This:-
Results start sheet(3) "A2"
Code:
[COLOR="Navy"]Sub[/COLOR] MG04May22
[COLOR="Navy"]Dim[/COLOR] Rng [COLOR="Navy"]As[/COLOR] Range, Dn [COLOR="Navy"]As[/COLOR] Range
[COLOR="Navy"]Dim[/COLOR] ACRng [COLOR="Navy"]As[/COLOR] Range
[COLOR="Navy"]Dim[/COLOR] nAcRng [COLOR="Navy"]As[/COLOR] Range
[COLOR="Navy"]Dim[/COLOR] c [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long[/COLOR]
[COLOR="Navy"]Dim[/COLOR] Ac [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long[/COLOR]
[COLOR="Navy"]Dim[/COLOR] n [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Integer[/COLOR]
[COLOR="Navy"]Set[/COLOR] Rng = Range(Range("A3"), Range("A" & rows.Count).End(xlUp))
[COLOR="Navy"]Set[/COLOR] ACRng = Range(Range("C2"), Cells(2, Columns.Count).End(xlToLeft))
ReDim Ray(1 To Rng.Count * ACRng.Count, 1 To 4)
[COLOR="Navy"]For[/COLOR] [COLOR="Navy"]Each[/COLOR] Dn [COLOR="Navy"]In[/COLOR] Rng
 c = c + 1
    [COLOR="Navy"]Set[/COLOR] nAcRng = ACRng.Offset(c)
        [COLOR="Navy"]For[/COLOR] Ac = 1 To nAcRng.Count
            n = n + 1
            Ray(n, 1) = Dn: Ray(n, 2) = Dn.Offset(, 1)
            Ray(n, 3) = ACRng(Ac): Ray(n, 4) = Dn(, Ac + 2)
        [COLOR="Navy"]Next[/COLOR] Ac
    [COLOR="Navy"]Next[/COLOR] Dn
Sheets("Sheet3").Range("A2").Resize(n, 4) = Ray
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]
Regards Mick
 
Upvote 0

Forum statistics

Threads
1,224,609
Messages
6,179,879
Members
452,948
Latest member
Dupuhini

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top