+ Reply to Thread
Results 1 to 5 of 5

take extra columns of rows and move to new line

  1. #1
    Registered User
    Join Date
    02-17-2011
    Location
    Cesky Krumlov
    MS-Off Ver
    Excel 2007
    Posts
    3

    Cool take extra columns of rows and move to new line

    Hi,
    Thanks for checking out this post. I have a question about some data I need to sort. I imagine an excel macro is going to be the answer, but I don't have any idea how to code what I need. If you might be able to help, please read on!

    Basically, I have data arranged in the following way:
    DateA NameA Word1a Word2a
    DateB NameB Word1b
    DateC NameC Word1c Word2c Word3c Word4c
    and so forth.

    In other words, there are always A, B and C column, but there may also be a D through ?? column. What I need to do is to move any data in the D+ columns to a new row with the information in columns A and B from the row it was originally on duplicated.

    So, using the macro would result in something like this:
    DateA NameA Word1a
    DateA NameA Word2a
    DateB NameB Word1b
    DateC NameC Word1c
    DateC NameC Word2c
    DateC NameC Word3c
    DateC NameC Word4c
    etc.

    Thanks in advance for any help!

    Nick

  2. #2
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: take extra columns of rows and move to new line

    You could use this code:
    Please Login or Register  to view this content.
    Regards,
    Antonio

  3. #3
    Registered User
    Join Date
    02-17-2011
    Location
    Cesky Krumlov
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: take extra columns of rows and move to new line

    Wow, this works great. Thanks for the quick reply, too!

    Although, I goofed, and there are 3 cells that need to be reproduced when a new row is made, not just 2. I played around with the numbers in the code you posted but only managed to break things or do funky stuff. Could you show whatever changes need to be made to do this? Sorry!

  4. #4
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: take extra columns of rows and move to new line

    In this macro you can change fixed Columns number:
    Please Login or Register  to view this content.
    Regards,
    Antonio

  5. #5
    Registered User
    Join Date
    02-17-2011
    Location
    Cesky Krumlov
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: take extra columns of rows and move to new line

    Thanks Antonio. It works perfectly. You rock!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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