+ Reply to Thread
Results 1 to 7 of 7

Transpose the data in alternate column

  1. #1
    Registered User
    Join Date
    03-13-2010
    Location
    bangalore
    MS-Off Ver
    Excel 2003
    Posts
    8

    Transpose the data in alternate column

    Hi,

    I need to get the data transposed in an excel worksheet. I have attached an excel sheet with the samle data. Can some one help me with a macro which can transpose the column data into row data?

    Your help is much appreciated,

    regards
    Harsha
    Attached Files Attached Files
    Last edited by hputhraya; 03-23-2010 at 06:17 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    11-11-2008
    Location
    Euro
    MS-Off Ver
    2007, 2010
    Posts
    470

    Re: Transpose the data in alternate column

    Quote Originally Posted by hputhraya View Post
    Hi,
    ...transpose the column data into row data?
    Why don't you use the Paste special function in Edit menu, or follow steps:

    - Selection the copied range, then Press Ctrl+C
    - Right Click on the cell needed paste and chose Paste special and then tick Transpose in the appeared dialog ->OK

    IF you want to make a SUB (code) -> recorded the above steps and recoding for being suitable

    ------

  3. #3
    Registered User
    Join Date
    03-13-2010
    Location
    bangalore
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Transpose the data in alternate column

    Hi,
    I tried using paste special with transpose option, but it is not giving me the output as desired.
    I have tried out it in the attachment.

    Regards
    Harsha
    Attached Files Attached Files

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Transpose the data in alternate column

    This macro will do what you've described. I assume there will be many paired rows with data in it, so this will work to reorganize them all. It will also serve if there really is just one.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Transpose the data in alternate column

    You've indicated in a private message that there are over 30,000 rows of this data. You're going to run out of room before this macro is finished, there are only 65,536 rows available in Excel 2003.

    Note, your current layout is actually superior to the one you are trying to change to...the only change I would recommend is putting all the values in a single row for one item rather than having them spread over multiple columns.

    Reformatting to the Column format like you've asked makes a much less usable/reportable/analyzable dataset.

  6. #6
    Registered User
    Join Date
    03-13-2010
    Location
    bangalore
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Transpose the data in alternate column

    Thanks a lot Jerry. You made my work so much easier!!
    I'm using excel 2007, which i believe has 1 milllion rows.
    As you said, the current layout is superior to analyse, but i have to load it into SQL Server 2005 table which makes it impossible with my original layout.

    Well, thanks for all the info!!

    Cheers
    Harsha

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Transpose the data in alternate column

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

+ Reply to Thread

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