+ Reply to Thread
Results 1 to 22 of 22

Vb macro coding for transpose - complete coding?

  1. #1
    Forum Contributor
    Join Date
    07-23-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    106

    Vb macro coding for transpose - complete coding?

    I need vb macro coding for transpose of the columns into rows. For every particular values in the columns it has to be converted into row... please give me the complete coding.. I m also attaching the excel file for your easy understanding in which I worked out the output manually.

    for example:MAIL SHEET.xls
    my file is like:

    SEASON TT AVG

    1969 101.161 1
    1969 194.153 1
    1969 293.158 1
    1969 399.223 1
    1969 493.957 1
    1969 592.859 1
    1969 695.993 1
    1969 799.896 1
    1969 898.796 0.97975
    1969 992.491 0.872875
    1969 1095.091 0.831545455
    1969 1197.457 0.925555556
    1969 1294.023 1
    1969 1332.157 1
    1970 188.779 1
    1970 289.604 1
    1970 399.108 1
    1970 492.429 1
    1970 590.643 1
    1970 698.64 1
    1970 798.331 1
    1970 897.446 1
    1970 997.731 1
    1970 1094.025 1
    1970 1188.725 1
    1970 1289.228 1
    1970 1338.614 1
    1971 197.372 1
    1971 288.457 1
    1971 390.265 1
    1971 499.621 1
    1971 591.528 1
    1971 699.252 1
    1971 793.552 1
    1971 894.453 0.857
    1971 995.753 0.515
    1971 1096.052 0.5192
    1971 1193.549 0.684555556
    1971 1288.905 0.972777778
    1971 1344.074 0.8864
    1972 199.619 1
    1972 292.708 1
    1972 393.503 1
    1972 492.605 1
    1972 597.546 1
    1972 692.609 0.9921
    1972 794.127 0.844166667
    1972 892.288 0.394142857
    1972 997.889 0.35875
    1972 1096.423 0.987428571
    1972 1188.861 1
    1972 1291.608 1
    1972 1342.19 1

    OUTPUT:
    I need output to be in the form as follows:

    1969 1 1 1 1 1 1 1 1 0.97975 0.8728 0.83155 0.92555 1 1
    1970 1 1 1 1 1 1 1 1 1 1 1 1 1 -
    1971 1 1 1 1 1 1 1 0.857 0.515 0.5192 0.684555556 0.972777778 0.8864 -
    1972 1 1 1 1 1 0.9921 0.844 0.39414 0.35875 0.9874 1 1 1 -

  2. #2
    Registered User
    Join Date
    11-14-2010
    Location
    Macau
    MS-Off Ver
    Excel 2003
    Posts
    66

    Re: Vb macro coding for transpose - complete coding?

    Please try this.
    Please Login or Register  to view this content.

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Vb macro coding for transpose - complete coding?

    try
    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Vb macro coding for transpose - complete coding?

    Maybe:

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    07-23-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    106

    Re: Vb macro coding for transpose - complete coding?

    lotuxel,

    Thank for the quick response...
    but the code is not working... pls help me by doing some modifications... for easy understanding of the output, please refer the attached excel file, in that I did manually...

  6. #6
    Forum Contributor
    Join Date
    07-23-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    106

    Re: Vb macro coding for transpose - complete coding?

    Dear Jindon,

    Thank for the quick response...
    but the code is not working... pls help me by doing some modifications... for easy understanding of the output, please refer the attached excel file, in that I did manually...

  7. #7
    Forum Contributor
    Join Date
    07-23-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    106

    Re: Vb macro coding for transpose - complete coding?

    Dear John H.Davis,

    Thank for the quick response...
    but the code is not giving the required output... pls help me by doing some modifications... for easy understanding of the output, please refer the attached excel file, in that I did manually...

  8. #8
    Registered User
    Join Date
    11-14-2010
    Location
    Macau
    MS-Off Ver
    Excel 2003
    Posts
    66

    Re: Vb macro coding for transpose - complete coding?

    The code is in file, click button to try.
    Attached Files Attached Files

  9. #9
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Vb macro coding for transpose - complete coding?

    Quote Originally Posted by Dharani Suresh View Post
    Dear John H.Davis,

    Thank for the quick response...
    but the code is not giving the required output... pls help me by doing some modifications... for easy understanding of the output, please refer the attached excel file, in that I did manually...
    Maybe:

    Please Login or Register  to view this content.

  10. #10
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Vb macro coding for transpose - complete coding?


  11. #11
    Forum Contributor
    Join Date
    07-23-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    106

    Re: Vb macro coding for transpose - complete coding?

    Dear lotuxel,
    Yes I tried... its amazing... by one click, the output is coming... Thank you so much... Really you are great by giving such speedy answer.
    but I think this button works only with this excel sheet, its not working in some other excel files. please kindly I request you to give the code which is dynamic so that it could work with all the excel files because like this I have 100 files.. please do help me... and also I request you to give this code for the creation of this button...

  12. #12
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Vb macro coding for transpose - complete coding?

    try the attached
    Attached Files Attached Files

  13. #13
    Forum Contributor
    Join Date
    07-23-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    106

    Re: Vb macro coding for transpose - complete coding?

    Quote Originally Posted by jindon View Post
    try the attached
    Dear Jindon,
    Thank you so much for your quick response... but the code is not working, it is showing sum error actually... error runtime
    error :429 and it is saying that activex component cannot create object. Please debug this error and send me the excel sheet.... please oblige and do the needful...tomorrow i need to submit this...pls do help me...

    Thanks & Regards,
    Dharani Suresh.

  14. #14
    Forum Contributor
    Join Date
    07-23-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    106

    Re: Vb macro coding for transpose - complete coding?

    Dear Jindon,
    Thank you so much for your quick response... but the code is not working, it is showing sum error actually... error runtime
    error :429 and it is saying that activex component cannot create object. Please debug this error and send me the excel sheet.... please oblige and do the needful...tomorrow i need to submit this...pls do help me...

    Thanks & Regards,
    Dharani Suresh.

  15. #15
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Vb macro coding for transpose - complete coding?

    Try set the reference to Microsoft Scripting Runtime.

    While you are in VBE,

    [Tools] - [References] tick [Microsoft Scripting Runtime] - [OK]

  16. #16
    Registered User
    Join Date
    11-14-2010
    Location
    Macau
    MS-Off Ver
    Excel 2003
    Posts
    66

    Re: Vb macro coding for transpose - complete coding?

    Quote Originally Posted by Dharani Suresh View Post
    Dear lotuxel,
    Yes I tried... its amazing... by one click, the output is coming... Thank you so much... Really you are great by giving such speedy answer.
    but I think this button works only with this excel sheet, its not working in some other excel files. please kindly I request you to give the code which is dynamic so that it could work with all the excel files because like this I have 100 files.. please do help me... and also I request you to give this code for the creation of this button...

    HI Dharani Suresh,
    Let teach you one tip,
    1. in the under of opened this file (that I send included macro),
    1.1. right click on Menu Bar at the top of the excel sheet, choose [Custom Quick Access Toolbar]
    1.2. Choose [Macro] at drop down list "Choose command from"
    1.3. You will see the Macro name [jw_test], then add to right listbox, you can modify any icons you like and OK.
    1.4. you can see this icon every excel files which you loaded and it will function any excel files that with same requirement.
    good luck!

  17. #17
    Forum Contributor
    Join Date
    07-23-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    106

    Re: Vb macro coding for transpose - complete coding?

    Dear Jindon,
    Thank you for the amazing code.... its working.. My heartfelt thanks to you.. you saved my head from my Boss....
    could you please do me another small help?????
    the code what you gave has to be little modified according to the following excel sheet.. every time I have to copy an paste these columns separately in a new sheet and then I have to work with your code which is time consuming. it would be highly grateful and helpful for me, if you able to modify this code with the following attached excel sheet. I think maybe my question may not that much clear for you and so I m attaching the full excel sheet with this for your kind reference and easy understanding...
    please oblige and do the needful...

    Thanks & Regards,
    Dharani.
    Attached Files Attached Files

  18. #18
    Forum Contributor
    Join Date
    07-23-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    106

    Re: Vb macro coding for transpose - complete coding?

    Quote Originally Posted by lotuxel View Post
    HI Dharani Suresh,
    Let teach you one tip,
    1. in the under of opened this file (that I send included macro),
    1.1. right click on Menu Bar at the top of the excel sheet, choose [Custom Quick Access Toolbar]
    1.2. Choose [Macro] at drop down list "Choose command from"
    1.3. You will see the Macro name [jw_test], then add to right listbox, you can modify any icons you like and OK.
    1.4. you can see this icon every excel files which you loaded and it will function any excel files that with same requirement.
    good luck!
    Dear lotuxel,
    Thank you for the amazing code.... its working.. My heartfelt thanks to you.. you saved my head from my Boss....
    could you please do me another small help?????
    the code what you gave has to be little modified according to the following excel sheet.. every time I have to copy an paste these columns separately in a new sheet and then I have to work with your code which is time consuming. it would be highly grateful and helpful for me, if you able to modify this code with the following attached excel sheet. I think maybe my question may not that much clear for you and so I m attaching the full excel sheet with this for your kind reference and easy understanding...
    please oblige and do the needful...

    Thanks & Regards,
    Dharani.
    Attached Files Attached Files

  19. #19
    Registered User
    Join Date
    11-14-2010
    Location
    Macau
    MS-Off Ver
    Excel 2003
    Posts
    66

    Re: Vb macro coding for transpose - complete coding?

    Duplicated sorry
    Last edited by lotuxel; 08-02-2013 at 03:19 AM.

  20. #20
    Forum Contributor
    Join Date
    07-23-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    106

    Re: Vb macro coding for transpose - complete coding?

    Quote Originally Posted by lotuxel View Post
    HI Dharani Suresh,
    Let teach you one tip,
    1. in the under of opened this file (that I send included macro),
    1.1. right click on Menu Bar at the top of the excel sheet, choose [Custom Quick Access Toolbar]
    1.2. Choose [Macro] at drop down list "Choose command from"
    1.3. You will see the Macro name [jw_test], then add to right listbox, you can modify any icons you like and OK.
    1.4. you can see this icon every excel files which you loaded and it will function any excel files that with same requirement.
    good luck!
    Dear lotuxel,
    Thank you for the amazing code.... its working.. My heartfelt thanks to you and also for the great tip... you saved my head from my Boss....
    could you please do me another small help?????
    the code what you gave has to be little modified according to the following excel sheet.. every time I have to copy an paste these columns separately in a new sheet and then I have to work with your code which is time consuming. it would be highly grateful and helpful for me, if you able to modify this code with the following attached excel sheet. I think maybe my question may not that much clear for you and so I m attaching the full excel sheet with this for your kind reference and easy understanding...
    please oblige and do the needful...

    Thanks & Regards,
    Dharani.
    Attached Files Attached Files

  21. #21
    Forum Contributor
    Join Date
    07-23-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    106

    Re: Vb macro coding for transpose - complete coding?

    Quote Originally Posted by jindon View Post
    try the attached
    Dear Jindon,
    Thank you for the amazing code.... its working.. My heartfelt thanks to you.. you saved my head from my Boss....
    could you please do me another small help?????
    the code what you gave has to be little modified according to the following excel sheet.. every time I have to copy an paste these columns separately in a new sheet and then I have to work with your code which is time consuming. it would be highly grateful and helpful for me, if you able to modify this code with the following attached excel sheet. I think maybe my question may not that much clear for you and so I m attaching the full excel sheet with this for your kind reference and easy understanding...
    please oblige and do the needful...

    Thanks & Regards,
    Dharani.
    Attached Files Attached Files

  22. #22
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Vb macro coding for transpose - complete coding?

    Not clear at all.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Help with coding a macro
    By rlkerr in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 02-20-2014, 02:48 PM
  2. [SOLVED] CheckBox coding to work with ComboBox coding
    By JimExcel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-05-2013, 12:23 PM
  3. Coding and Reverse Coding a Questionnaire
    By lorr3 in forum Excel General
    Replies: 2
    Last Post: 11-18-2012, 06:43 PM
  4. Coding to make a transpose values button
    By Sally in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-30-2006, 06:15 PM
  5. Implant macro coding into ASP coding
    By Sam yong in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-15-2005, 06:05 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1