+ Reply to Thread
Results 1 to 4 of 4

How do i move like data in columns to single rows?

  1. #1
    Registered User
    Join Date
    07-16-2012
    Location
    NC USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    How do i move like data in columns to single rows?

    I have a spreadsheet that lists transactions numbers for ticket sold for our event. Each transaction number may have two or more entries and are in column form. I want to move the like data for each matching transaction number to the same (or one) row.

    For example:
    1060002 George Wallace Guest W67
    1060002 Karen Cline Wallace W67


    In this case, my name should really be above George's. But I want to also move my data to the same row.

    1013137 Larry Parks W68
    1013137 Diane Parks Guest W68


    In other words, the graduate should always be listed before the guest.

    I want it to look like this:

    1013137 Larry Parks W68 1013137 Diane Parks Guest W68


    If we can eliminate the second transaction # 103137, that would be great too.

    Each year, we go through this and manually manipulate the data. it would be easier I we could automate it as we download new entries. I realize I will need to manipulate some of the data where one person paid for 6 with different names but I can work with that.

    Appreciate any help to get me started. We are a high school reunion with 2 schools, classes of the 60s and ussally end up with at least 650 attendees.
    Thanks,
    Karen
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: How do i move like data in columns to single rows?

    Hello there,

    Attached is your original file updated to include a macro that I believe accomplishes what you are trying to achieve.

    To try the macro, select the worksheet Original(2) - this is a copy of the Orginal worksheet you provided.
    Then hit Alt+F8 on your keyboard to bring up the macro window. Select the AddToSameRow macro and then select Run.

    To insert this macro into your workbook. Go to your workbook and then hit Alt+F8. Clear the contents in the macro name and then Type AddToSameRow and select Create.

    Copy and paste the below code between the Sub AddToSameRow and End Sub. Anything that appears in green is a comment meant to help you understand the code.

    Please Login or Register  to view this content.
    Exit out of the Visual Basic window and then press Alt+F8 again. This time select the AddToSameRow option and select Run to run it.

    Let me know if this is what you were looking for and if you have any questions!

    Thanks!

    RVASQUEZ
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    07-16-2012
    Location
    NC USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: How do i move like data in columns to single rows?

    Thanks for your assistance.

    I thought I did exactly as you indicated to try the macro without the create part.
    To get to the macro:
    I clicked View>Macro >View Macro
    Selected AddToSameRow
    Clicked Run.

    When it ran, it did not keep the records with like transaction numbers together. That is the key. In fact, I do not understand the macro data enough to figure out how to change it. Typically, there is one graduate and one guest who may or may not have the same last name. Some entries have more than one guest and some entries do not have a guest.

    I am attaching the file with the original edited so that all entries show the grad name first and then the guest(s) name.

    Thanking you in advance for your help!
    Karen
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: How do i move like data in columns to single rows?

    Sorry about that I didn't test it with deleting the rows and that messed up the count putting the individuals next to the wrong cell.

    Let's try this one.

    Open your document and press Alt+F8 again on your keyboard. Select the AddToSameRow macro I gave you before and then select the Step Into option. Delete the entire coding from the area provided.

    Then copy and paste the below coding into the space you just deleted the coding from.

    Option Explicit
    Dim Lr As String

    Please Login or Register  to view this content.
    Exit out of the Visual Basic window then select Alt+F8 on your keyboard and select the AddToSameRow macro and select Run.

    Let me know if this works for you!

    Thanks!

+ 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