+ Reply to Thread
Results 1 to 7 of 7

Transpose 2 dim. table into vector

  1. #1
    Forum Contributor
    Join Date
    11-28-2008
    Location
    Reykjavík, Iceland
    MS-Off Ver
    Any of: 2003 & 2007
    Posts
    412

    Transpose 2 dim. table into vector

    Hi, all,

    I explained my request in detail inside the attached WB.

    Thanks, Elm
    Attached Files Attached Files
    Last edited by ElmerS; 10-24-2009 at 02:29 PM.

  2. #2
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Transpose 2 dim. table into vector

    ElmerS,

    See the attached workbook "Transpose 2 dim table into vector with unique values - ElmerS - SDG10.xls" with macro "CreateVector".

    You can run the macro on either of the two sheets (there can be no data on row 1 to the right of your raw data).
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  3. #3
    Forum Contributor
    Join Date
    11-28-2008
    Location
    Reykjavík, Iceland
    MS-Off Ver
    Any of: 2003 & 2007
    Posts
    412

    Re: Transpose 2 dim. table into vector

    Thanks, Stanley,

    There must be something wrong with your attached file.

    I get an Excel Error upon trying to open it (directly or after saving it to HD) and after it is recovered there is no VBA Code inside.

    Please try again and maybe a zipped WB will do better.

    Elm
    Last edited by ElmerS; 10-24-2009 at 02:14 AM.

  4. #4
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Transpose 2 dim. table into vector

    ElmerS,

    Try:

    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

    Adding the Macro
    1. Copy the below macro, by highlighting the macro code and pressing the keys CTRL + C
    2. Open your workbook
    3. Press the keys ALT + F11 to open the Visual Basic Editor
    4. Press the keys ALT + I to activate the Insert menu
    5. Press M to insert a Standard Module
    6. Paste the code by pressing the keys CTRL + V
    7. Press the keys ALT + Q to exit the Editor, and return to Excel


    Please Login or Register  to view this content.

    In order for the macro to work correctly you can not have anything to the right of of the first row of your raw data (range A1:C1.

    Then run the "CreateVector" macro.

  5. #5
    Forum Contributor
    Join Date
    11-28-2008
    Location
    Reykjavík, Iceland
    MS-Off Ver
    Any of: 2003 & 2007
    Posts
    412

    Re: Transpose 2 dim. table into vector

    Thanks a lot.
    Elm

  6. #6
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Transpose 2 dim. table into vector

    ElmerS,

    Updated code using arrays (much faster):


    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    11-28-2008
    Location
    Reykjavík, Iceland
    MS-Off Ver
    Any of: 2003 & 2007
    Posts
    412

    Re: Transpose 2 dim. table into vector

    Thaks a lot, Stanley,

    Elm

+ Reply to Thread

LinkBacks (?)

  1. Page
    Refback This thread
    10-04-2013, 06:03 AM

Thread Information

Users Browsing this Thread

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

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