+ Reply to Thread
Results 1 to 3 of 3

Macro : Split text of a single cell into multiple cell

  1. #1
    Registered User
    Join Date
    06-05-2012
    Location
    Indonesia
    MS-Off Ver
    Excel 2007
    Posts
    18

    Macro : Split text of a single cell into multiple cell

    I'm new to this forum and know very little about macro.
    so far have been copying/pasteing other people macro to work with which is ok until now.

    i attached my workbook with dummy data on it.

    my situation :
    when i run macro "ROW_SELECTED_to_NewSheet" in sheet "Data" (pointing at row 3), it will copy cell D3 & T3 into newly created sheet.

    my problem:
    when i looked into the newly created sheet, the cell C9 (the one contains text from cell T3 in sheet "Data") is not displaying the whole text.

    i know that row height in excel is limted to 545 pixels. so i'm thinking of spliting the text of T3 into several cells.
    but this split should be done in the newly created sheet automaticaly

    can someone guide how achieve this by modifying my existing macro "ROW_SELECTED_to_NewSheet" so that it will do the below tasks automaticaly :
    1) export data into new sheet
    2) automaticaly split the text of T3 into several cells (i.e 2 or 3 cells) in the newly created sheet so that all the text in T3 can be displayed.


    rampal,
    Attached Files Attached Files

  2. #2
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Macro : Split text of a single cell into multiple cell

    Try this,
    With all due respects to Jerry's code, as he is a member here. I hope he does not mind me altering it.
    You will have to format your template accordingly. But this will allow you to show all text.
    Attached Files Attached Files
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  3. #3
    Registered User
    Join Date
    06-05-2012
    Location
    Indonesia
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Macro : Split text of a single cell into multiple cell

    Quote Originally Posted by JapanDave View Post
    Try this,
    With all due respects to Jerry's code, as he is a member here. I hope he does not mind me altering it.
    You will have to format your template accordingly. But this will allow you to show all text.
    hi JapanDave,

    many thanks for looking on my problem.it almost did what i want to achieve, except that with your code the exported text is being wrapped. where as what i hope to achieve that the line breaks will stay as it was (just like the original one in the sheet "Data")

    say, if i export row no 3 form sheet "Data", then your code will result this text:

    Automobili Lamborghini was founded by Ferruccio Lamborghini, the child of viticulturists from the comune (township) of Renazzo di Cento, Province of Ferrara, in the Emilia-Romagna region of Northern Italy.[1][4] After serving as a mechanic in the Regia Aeronautica[5][6] during World War II, Lamborghini went into business building tractors out of leftover military hardware from the war effort. By the mid-1950s, Lamborghini's tractor company, Lamborghini Trattori S.p.A.,[7] had become one of the largest agricultural equipment manufacturers in the country.[8] He was also the owner of a successful gas heater and air conditioning manufacturer.[5][8][9]


    where what i want to achieve is:

    Automobili Lamborghini was founded by Ferruccio Lamborghini, the child of
    viticulturists from the comune (township) of Renazzo di Cento, Province of
    Ferrara, in the Emilia-Romagna region of Northern Italy.[1][4] After serving as a
    mechanic in the Regia Aeronautica[5][6] during World War II, Lamborghini went
    into business building tractors out of leftover military hardware from the war effort.
    By the mid-1950s, Lamborghini's tractor company, Lamborghini Trattori S.p.A.,[7] had
    become one of the largest agricultural equipment manufacturers in the country.[8]
    He was also the owner of a successful gas heater and air conditioning manufacturer.[5][8][9]


    note the diffrences on the line breaks

    appreciate your further assistance

    rampal,

+ 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