+ Reply to Thread
Results 1 to 7 of 7

split the text in a cell into rows

  1. #1
    Registered User
    Join Date
    01-19-2011
    Location
    hyderabad, India
    MS-Off Ver
    Excel 2007
    Posts
    17

    split the text in a cell into rows

    hi,
    I'm new to excel.
    I want a macro to split text in a cell to rows and the cell formated to wrap text with a fixed length and the text should be splitted till the end of the text in line one of a cell.
    Pls find the attached example.
    test.xlsx

    In the above example, the text should be splitted in A1 cell till "It is mainly concerned with recording of financial data relating to the " and the second line in cell one into new row i.e.,"business operations in a significant and orderly manner." and if a cell contain third line then it should be splitted into third row and so on so forth...

    Your help is greatly appreciated....

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: split the text in a cell into rows

    Hi rrakkki
    why not just use the "text to columns" feature with fixed lenght?
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Valued Forum Contributor
    Join Date
    06-17-2009
    Location
    Chennai,India
    MS-Off Ver
    Excel 2003,excel 2007
    Posts
    678

    Re: split the text in a cell into rows

    try this macro(assuming it does not exceed 210 characters(that is it can run up to three rows)
    (this is not fixed length but very nearly as fixed length may split a word)
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    I am sending you the file "rrakki.xlsm" after running the macro "test"
    you can run undo and again run test.
    Attached Files Attached Files
    Last edited by venkat1926; 11-10-2011 at 04:27 AM.

  4. #4
    Registered User
    Join Date
    01-19-2011
    Location
    hyderabad, India
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re : split the text in a cell into rows

    thanks for ur help..
    but when i replaced the text with another text.. i'm getting error.."Unable to get the search property of the worksheetfunction class....
    more over... the text in a cell is not fixed...it can be any number of words and the column width is "72", if the data in a cell exceed the specified width then it should be splitted into next "row" and i have 21 rows...that needs to be splitted at one time... and each cell of a row should not cross column width of "72"
    here i'm attaching a new sheet...
    Please help me....
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-19-2011
    Location
    hyderabad, India
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: split the text in a cell into rows

    can anyone pls help me......

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,379

    Re: split the text in a cell into rows

    Hi rrakki,

    See if the NON-VBA example attached doesn't do almost what you want.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  7. #7
    Registered User
    Join Date
    01-19-2011
    Location
    hyderabad, India
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: split the text in a cell into rows

    thank u

+ 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