+ Reply to Thread
Results 1 to 8 of 8

Displaying single line of text on several lines in a textbox

Hybrid View

  1. #1
    Registered User
    Join Date
    06-21-2010
    Location
    Gothenburg
    MS-Off Ver
    Excel 2003
    Posts
    50

    Displaying single line of text on several lines in a textbox

    Hello

    This might be a little confusing so bear with me. I want a single line textbox (i.e. MultiLine = False) because I don't want the user to be able to manually change line nor do I want the text displayed to actually contain newlines. I want the textbox to display the one line of text on several lines when it runs out of space on the first line.

    Ideas?

    Thanks in advance

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Displaying single line of text on several lines in a textbox

    Can't you set the wordwrap property to true?

  3. #3
    Registered User
    Join Date
    06-21-2010
    Location
    Gothenburg
    MS-Off Ver
    Excel 2003
    Posts
    50

    Re: Displaying single line of text on several lines in a textbox

    Quote Originally Posted by arthurbr View Post
    Can't you set the wordwrap property to true?
    Already True, doesn't seem to effect the lines.

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Displaying single line of text on several lines in a textbox

    .AutoSize = True ?

  5. #5
    Registered User
    Join Date
    06-21-2010
    Location
    Gothenburg
    MS-Off Ver
    Excel 2003
    Posts
    50

    Re: Displaying single line of text on several lines in a textbox

    Quote Originally Posted by snb View Post
    .AutoSize = True ?
    Not what I'm looking for, I want the size of the textbox to remain the same but when the string entered reaches the end of the textbox I want it to automatically move to the next line. I don't, however, want the string to contain any actual newlines.

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,971

    Re: Displaying single line of text on several lines in a textbox

    Where is the textbox? If on a sheet, what kind is it (i.e. how did you create it)?
    Everyone who confuses correlation and causation ends up dead.

  7. #7
    Registered User
    Join Date
    06-21-2010
    Location
    Gothenburg
    MS-Off Ver
    Excel 2003
    Posts
    50

    Re: Displaying single line of text on several lines in a textbox

    Quote Originally Posted by romperstomper View Post
    Where is the textbox? If on a sheet, what kind is it (i.e. how did you create it)?
    It's in a userform. I use the MSForms.TextBox control. I created it using the toolbox.

  8. #8
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,971

    Re: Displaying single line of text on several lines in a textbox

    You'll have to have it as multi-line too and replace any vbCrLf characters when you exit the control

+ 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