+ Reply to Thread
Results 1 to 8 of 8

Cannot split data from a single row with carriage return

  1. #1
    Registered User
    Join Date
    06-21-2017
    Location
    Italy
    MS-Off Ver
    2016
    Posts
    4

    Cannot split data from a single row with carriage return

    Hi all guys,
    I got a strange problem and I cannot find a solution anywhere.

    I got an huge excel file where the data is formatted by carriage return in each row.
    So i got a lot of values in the same row but I need to have all the data on different rows.

    This is getting me crazy but I cannot find a way to "split" the value from a single row to multiple rows.

    I attach here an example.

    Thanks for your time
    Attached Files Attached Files

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Cannot split data from a single row with carriage return

    Enter formula in A4 and copy formula across and down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    But I think you would need a VBA solution for this
    v A B C
    1 what i got
    2 name1
    name2
    surname1
    surname2
    tel1
    tel2
    3
    4 name1 surname1 tel1
    5 name2 surname2 tel2
    Last edited by AlKey; 06-21-2017 at 01:46 PM.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Cannot split data from a single row with carriage return

    Here's a simple macro that will do that.
    Assumes the relevant cells are A2:C2

    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    06-21-2017
    Location
    Italy
    MS-Off Ver
    2016
    Posts
    4

    Re: Cannot split data from a single row with carriage return

    Hi Alkey.
    The real problem is that the values are charlenght variable .... it could be "surname1" or "surnamenew1" ..... that's why i'm getting mad!

    My VBA skills are really really poor .....

  5. #5
    Registered User
    Join Date
    06-21-2017
    Location
    Italy
    MS-Off Ver
    2016
    Posts
    4

    Re: Cannot split data from a single row with carriage return

    Hi Richard. Thanks for your answer.
    If I need to loop this for all rows (for example a2,a3,an,b2,b3,bn,c1,c2,cn) ?
    Moreover my values are not all "char(10)" .... it could be "surname1" or "surnamenew1" .... all the values change in my file.

    How can I manage this ?

    Thank you for your time

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Cannot split data from a single row with carriage return

    Hi,

    Your original only mentioned one cell in each column. The implication being that all the names etc. were contained therein, all separated by a Carriage Return Chr(10)

    This is clearly a much simplified example and probably doesn't represent the size of your actual data. We often find that when we give an answer to what is a trivial non representative example when the solution is used with the real world data it doesn't work because of factors like string length and other stuff which is important but hasn't been mentioned.

    Therefore upload your real workbook (or at least a cut down copy).

    I'm not sure what you're getting at when you mention varying lengths for names. They are all presumably separated by a carriage return and the length of the name is irrelevant. I wasn't sure why you mentioned it when AlKey gave you a perfectly acceptable solution.

  7. #7
    Registered User
    Join Date
    06-21-2017
    Location
    Italy
    MS-Off Ver
    2016
    Posts
    4

    Re: Cannot split data from a single row with carriage return

    Hi again,
    that formula doesn't work for me :|

    I copied in A4 but it reports an error....

    I know .... I'm probably dumb :|

  8. #8
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Cannot split data from a single row with carriage return

    Quote Originally Posted by franklegas View Post
    Hi again,
    that formula doesn't work for me :|

    I copied in A4 but it reports an error....

    I know .... I'm probably dumb :|
    ...as I said, upload the workbook so that we know exactly what we're working with.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Split cells into multiple columns by carriage return
    By taylorcharley in forum Excel General
    Replies: 3
    Last Post: 11-12-2016, 07:59 AM
  2. [SOLVED] replacing two carriage return wit one carriage return
    By CDandVinyl in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-05-2015, 05:55 PM
  3. Replies: 1
    Last Post: 09-04-2015, 04:48 AM
  4. [SOLVED] delimit nonuniform data - carriage return?
    By kamelkid2 in forum Excel General
    Replies: 4
    Last Post: 01-19-2015, 01:18 PM
  5. Carriage return? Issue displaying data.
    By tomlufc in forum Excel General
    Replies: 3
    Last Post: 02-09-2012, 09:59 AM
  6. splitting cell data at carriage return points
    By rich80 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-17-2008, 03:29 AM
  7. How do you put a carriage return into some cell data?
    By iterature in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-26-2007, 07:49 AM

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