Results 1 to 8 of 8

Thread: Text Boxes

  1. #1
    Guest

    Question

    Hi

    Does this exist

    A text box which you can enter multiple lines of text but have VB notice them as seperate lines of text or text boxes.


    1 line one text
    2 line two text

    etc.


    Thanks in advance


    Oakey

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    SPlit

    You will have to dump it into an array...using Split()
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3
    Guest

    Question How

    Hi

    Thanks for that, do you happen to know any code for that.

    Thanks verymuch for that.


    Oakey

  4. #4
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Code:
    Private Sub Form_Load()
    Dim test As String
    Dim a() As String
    Dim i As Integer
    
    test = "Hello World, It Works"
    a = Split(test)
    For i = LBound(a) To UBound(a)
        MsgBox a(i)
    Next
    End
    End Sub

  5. #5
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Code:
    Private Sub Command1_Click()
        'contents of text1
           '1 line one text
           ' 2 line two text
        
        Dim sString As String
        Dim sVar
        sString = Text1
        sVar = Split(sString, vbCrLf)
        
        MsgBox sVar(0) '= 1 line one text
        MsgBox sVar(1) '= 2 line two text
    
    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  6. #6
    Guest

    Question Excel

    Hi Lethal

    That works great but forgive me i'am very new to VB, and i cant seem to work out how to integrate that code to my program.

    All the program does is export text boxes and dumps them into excel to various defined cells, the only problem is that most text boxes are only small with the exception of one, which is not masive.

    is it possible to do this


    Thanks in advance

    Mark

  7. #7
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Lethals code is not splitting lines it is splitting words.
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  8. #8
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Your right HeSaidJoe, I just threw in a few lines of code to show him some of the split functionality. Oakey, use HeSaidJoe's code, the only difference is the vbCrlf. I'm not sure on how to interface with excel, never messed with excel and vb together.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width