+ Reply to Thread
Results 1 to 10 of 10

Content of multiple lines, into one line.

  1. #1
    Registered User
    Join Date
    07-11-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    4

    Content of multiple lines, into one line.

    Testfile.xlsx

    Hi guys,

    As you can see in the file, there are multiple models on the left. And multiple models above.
    I want to copy the content of G2:R8 (so, all the o) to one line.

    Can i do that with a formula, because i have 8000 option codes?

    kind regards, and thansk in advance for all the help.
    Koen
    Last edited by koenus; 07-11-2012 at 06:09 AM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Content of multiple lines, into one line.

    Where do you want your solution?

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

    Re: Content of multiple lines, into one line.

    Can you please upload a sample output file showing how you want the output to be displayed?
    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]

  4. #4
    Registered User
    Join Date
    07-11-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Content of multiple lines, into one line.

    Testfile incl solution.xlsx

    Hi guys,

    thanks for the quick respons. i uploaded a file, wich contains the solution like i had in mind.

    regards,

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

    Re: Content of multiple lines, into one line.

    There are multiple model nos in column A in your original data. Should all the O's in those rows be combined into 1 row?

    What should the macro check for? Whether the entries in column C match from row to row and if yes, to combine the values in columns G to R?

  6. #6
    Registered User
    Join Date
    07-11-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Content of multiple lines, into one line.

    Hi Arlu1201,

    it's a bit hard to explain, but i'll give it a try.

    I want all the O's from every model, with the same optioncode (column B) combined in one row.
    As you can see in 'Solution, first step', All the O's of G3:R9 are combined in row 13. (because they all have the same option code.)
    After that i simply can delete the empty rows.

    Note that all the o's are allreay on the good spot (matching the model of column A with the models on the first row (in the file row 2).

    Hopefully this explanation does the trick .

    thanks for the help.
    regards,

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

    Re: Content of multiple lines, into one line.

    I think your explanation did do the trick.

    Try this code
    Please Login or Register  to view this content.
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

    To run the Excel VBA code:
    Choose View | Macros
    Select a macro in the list, and click the Run button

  8. #8
    Registered User
    Join Date
    07-11-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Content of multiple lines, into one line.

    Wooow arlu1201,

    Your code did the trick
    I applied it on the large file (+8000 rows) and it combined all the right elements.
    Thank you very much.

    You really made my day!

    regards,
    koen

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

    Re: Content of multiple lines, into one line.

    Am glad it worked.

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

    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    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

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

    Re: Content of multiple lines, into one line.

    Am glad it worked.

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

    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    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

+ 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