+ Reply to Thread
Results 1 to 5 of 5

Split a long text in a userform textbox to multiple rows on a worksheet

  1. #1
    Forum Contributor
    Join Date
    07-23-2012
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    211

    Split a long text in a userform textbox to multiple rows on a worksheet

    Hi

    I have a textbox in a userform where the user can input information. This text could be quite long and when it is printed on a worksheet cell, will overlap that cell.

    How can I create a vb code that will print only, say max 30 characters per row?

    Any advice will be much appreciated.

    Thanks

  2. #2
    Forum Expert
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    1,312

    Re: Split a long text in a userform textbox to multiple rows on a worksheet

    Hi something like:
    Please Login or Register  to view this content.
    Regards

    tom1977

    If You are satisfied with my solution click the small star icon on the left to say thanks.

  3. #3
    Forum Contributor
    Join Date
    07-23-2012
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    211

    Re: Split a long text in a userform textbox to multiple rows on a worksheet

    Thanks Tom, but wouldn't this only print the first 30 characters? How can I adapt your code to print the remaining characters in multiple rows?

  4. #4
    Forum Expert
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    1,312

    Re: Split a long text in a userform textbox to multiple rows on a worksheet

    maybe

    Please Login or Register  to view this content.
    ??

  5. #5
    Forum Contributor
    Join Date
    07-23-2012
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    211

    Re: Split a long text in a userform textbox to multiple rows on a worksheet

    Not sure if that would help because I wouldn't know how much text the user will input. If I keep using discrete cell code, I could be over or under the total length. Also, I would not want words to be split when the max length of 30 characters is reached. Maybe Len, Mid and Left is not the way here.

    Thanks anyway.

+ 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