+ Reply to Thread
Results 1 to 22 of 22

Transposing ~ 25,000 rows of data into Columns

  1. #1
    Registered User
    Join Date
    12-17-2009
    Location
    wilmington, delaware
    MS-Off Ver
    Excel 2003
    Posts
    15

    Talking Transposing ~ 25,000 rows of data into Columns

    I really could use some help here. I have ~25,000 rows of data, contact information, and I am trying to convert it to columns with the corresponding 9 column headers (Full Name, Job Title, Company, Business Street, Busines City, State, Business Phone, Business Fax, Web Page, E-Mail Address). The challenge is that each record does NOT have the same number of rows...?? I am new to this forum, so please forgive me if this a stupid question. I've attached the data for three records below and also in the attached spreadsheet.

    Row Labels Data in Rows
    Full Name Nick Strickland
    Job Title Vice President
    Company SC Products International
    Business Street 11 Airport Road
    Business City, State Redding, DE 96002-9217
    Business Phone 800-555-4545
    Business Fax 800-555-1234
    Web Page www.vicepresident.com
    E-Mail Address [email protected]
    Full Name Harry Parker
    Company Supply Industries
    Business Street 2166 South Flagler Ave.
    Business City, State Yuma, AZ 85365-2420
    Business Phone 800-555-4545
    Business Fax 800-555-1234
    Web Page www.peaceout.com
    Job Title Gen. Mgr.
    Company Handrew company
    Business Street 40 Brookside Court
    Business Street P. O. Box 12444
    Business City, State Nader, WI 45668
    Business Phone 800-555-4545
    Business Fax 800-555-1234
    Web Page www.hangtime.com
    E-Mail Address [email protected]
    Attached Files Attached Files
    Last edited by strickrn; 12-18-2009 at 09:01 AM.

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Transposing ~ 25,000 rows of data into Columns

    Hi strickrn,

    welcome to the forum.

    Is there an oversight in your data? I see only two names and the second name has two sets of addresses??

  3. #3
    Registered User
    Join Date
    12-17-2009
    Location
    wilmington, delaware
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Transposing ~ 25,000 rows of data into Columns

    This is a sample dataset to upload to the forum. I can copy and transpose for a small amount of data but would like a more elegant solution for the 25,000 rows or so of data that I'd like to convert.

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Transposing ~ 25,000 rows of data into Columns

    I understand your requirements. I was just wondering if the data sample you supplied contains errors, or if it is exemplary of the data you've got. We need to nail which row label serves as the indicator for a new record and if the Full Name may be missing, this must be taken into account.

  5. #5
    Registered User
    Join Date
    12-17-2009
    Location
    wilmington, delaware
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Transposing ~ 25,000 rows of data into Columns

    Ah....OK. The Row label "Company" can be used as the new row indicator. This is fun!

  6. #6
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Transposing ~ 25,000 rows of data into Columns

    So, if the company name is the trigger for a new record, does that mean that Harry Parker works for SC Products International?

    This does not make sense.

    Again: does your data sample contain errors, i.e. is there a Full Name missing betewen

    Web Page www.peaceout.com

    and

    Job Title Gen. Mgr.

    ???

  7. #7
    Registered User
    Join Date
    12-17-2009
    Location
    wilmington, delaware
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Transposing ~ 25,000 rows of data into Columns

    Yes. Data is missing randomly throughout the dataset. For example, the Full Name title may be missing for one company, Title may be missing for another, Email may be missing for another, so there is no repeatable consistent format to the column of data.

  8. #8
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Transposing ~ 25,000 rows of data into Columns

    so, in terms of human logic, how would you determine which row label flags the new record if any of them can be missing? Can it be assumed that

    - the row labels are always in the same order,
    - this is also the order of the columns you have specified
    - if a row label matches a column label, and that column label has already been filled in for the current record, then that means we're dealing with the next record?

    Please confirm or correct the logic.

  9. #9
    Registered User
    Join Date
    12-17-2009
    Location
    wilmington, delaware
    MS-Off Ver
    Excel 2003
    Posts
    15

    Smile Re: Transposing ~ 25,000 rows of data into Columns

    Yes, the row labels are always in the same order
    Yes, this is also the order of the columns you have specified
    Yes, if a row label matches a column label, and that column label has already been filled in for the current record, then that means we're dealing with the next record?

  10. #10
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Transposing ~ 25,000 rows of data into Columns

    OK VBA experts, I've done all the spec work, now it's up to you for the coding ...

  11. #11
    Valued Forum Contributor
    Join Date
    05-14-2009
    Location
    gold coast
    MS-Off Ver
    Excel 2007
    Posts
    843

    Re: Transposing ~ 25,000 rows of data into Columns

    Here is a quick shot at the code.
    Please Login or Register  to view this content.
    there is a added column to deal with post office address. It look ok too me though i didnt look to close
    Attached Files Attached Files
    Last edited by D_Rennie; 12-18-2009 at 05:55 AM.


  12. #12
    Valued Forum Contributor
    Join Date
    05-14-2009
    Location
    gold coast
    MS-Off Ver
    Excel 2007
    Posts
    843

    Re: Transposing ~ 25,000 rows of data into Columns

    i think this cracks it
    Please Login or Register  to view this content.
    probley not the most elegent way. Though as long as it works right.

    cheers

  13. #13
    Registered User
    Join Date
    12-17-2009
    Location
    wilmington, delaware
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Transposing ~ 25,000 rows of data into Columns

    Good morning. Thanks so much for your brilliance!!!! I'll give it a try and let you know what happens....

  14. #14
    Registered User
    Join Date
    12-17-2009
    Location
    wilmington, delaware
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Transposing ~ 25,000 rows of data into Columns

    D_Rennie - I installed the code and it worked perfectly. It filled in up to 2996 rows of data. I'm really dumb when it comes to macro writing, so is there a way to get it to transpose up to about 30,000 rows of data.

  15. #15
    Registered User
    Join Date
    12-17-2009
    Location
    wilmington, delaware
    MS-Off Ver
    Excel 2003
    Posts
    15

    Talking Re: Transposing ~ 25,000 rows of data into Columns

    DUH !!!!! OF COURSE IT STOPPED AT 2996 ROWS....That's how many records are in the dataset.....THIS IS BRILLIANT WORK....

    THANK YOU SO VERY MUCH.....

  16. #16
    Valued Forum Contributor
    Join Date
    05-14-2009
    Location
    gold coast
    MS-Off Ver
    Excel 2007
    Posts
    843

    Re: Transposing ~ 25,000 rows of data into Columns

    no probs just double cheek everythink is going where it should be.

  17. #17
    Registered User
    Join Date
    12-17-2009
    Location
    wilmington, delaware
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Transposing ~ 25,000 rows of data into Columns

    I worked PERFECT!!! Thanks so much. How do I label this thread as [SOLVED]?

  18. #18
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Transposing ~ 25,000 rows of data into Columns

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  19. #19
    Registered User
    Join Date
    01-29-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    70

    Lightbulb Re: Transposing ~ 25,000 rows of data into Columns

    I cant see the attached codes.

  20. #20
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Transposing ~ 25,000 rows of data into Columns

    What do you mean? Are you getting any error? Which post are you talking about?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  21. #21
    Registered User
    Join Date
    01-29-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    70

    Re: Transposing ~ 25,000 rows of data into Columns

    Hi! how about if I want to transpose many columns of data into rows and in different sheets?

    here is an example. But in reality, it is composed of different sheets (1 sheet per variable).

    I want the format to be like this:

    DATE (month/day/yr) Variable 1 Variable 2 Variable 3

    jan 1, 1999 3 4 5

    up to

    jan 31, 1999 6 7 8



    The raw data contains many years. I wish to have the format like the above one. 1 year per sheet.
    Attached Files Attached Files

  22. #22
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,318

    Re: Transposing ~ 25,000 rows of data into Columns

    It seems Arlette was asking a question...

    What do you mean? Are you getting any error? Which post are you talking about?
    ...but rather you posted a question.

    As per the forum rules, please start your own thread...
    Last edited by jeffreybrown; 01-29-2013 at 09:58 PM.
    HTH
    Regards, Jeff

+ 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