Text Boxes
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 7 of 7

Thread: Text Boxes

  1. #1
    New Member
    Join Date
    Mar 2002
    Location
    England
    Posts
    46
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    I have two problems.

    The first is is it possible to have six textboxes, that all go to the same cell. For example six names all going to a cell, all separated by a comma.

    The second is it possible to use that cell, and use it as inputs for six textboxes. Basically The reverse of the first problem.

  2. #2
    New Member
    Join Date
    Mar 2002
    Location
    England
    Posts
    46
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Desperately need help

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Location
    Chippenham, UK
    Posts
    136
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    you mean get each text box to be in control of part of an array?

    Would it not be easeier to use 6 different cells and then concatenate these into another cell?
    _________________
    Regards,

    Gary Hewitt-Long

    [ This Message was edited by: gplhl on 2002-03-07 11:09 ]

  4. #4
    New Member
    Join Date
    Mar 2002
    Location
    England
    Posts
    46
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks. I couldn't get it to work. I don't know how to create arrays. However, i found a different way to solve problem 1.

    To solve problem two, I was thinking about using some code to search for commas and then return the value i want.

    For example, in one cell i have

    Peter, Jim, Bob, Fred, Geoff, Jack


    What I want to do is put Peter in txtbox1, Jim in txtbox2 and so on (only a maximum of six). Does anyone know how to do this?

  5. #5
    Guest

    Default

    From the menu, choose Data, Text to columns, Delimited (using comma). This should work.

    On 2002-03-07 11:36, waggy30 wrote:
    Thanks. I couldn't get it to work. I don't know how to create arrays. However, i found a different way to solve problem 1.

    To solve problem two, I was thinking about using some code to search for commas and then return the value i want.

    For example, in one cell i have

    Peter, Jim, Bob, Fred, Geoff, Jack


    What I want to do is put Peter in txtbox1, Jim in txtbox2 and so on (only a maximum of six). Does anyone know how to do this?
    [/quote]

  6. #6
    New Member
    Join Date
    Mar 2002
    Location
    England
    Posts
    46
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    thanks, i never knew about that

  7. #7
    MrExcel MVP Mark O'Brien's Avatar
    Join Date
    Feb 2002
    Location
    Columbus, OH, USA
    Posts
    3,530
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Here's some code that will do number 2 as well.


    Public Sub ExtractNames()

    Dim iLength As Integer
    Dim sFullText As String
    Dim iThisFoundComma As Integer
    Dim iLastFoundComma As Integer
    Dim iCommaCount As Integer
    Dim i As Integer
    Dim sArray() As String
    Dim sChar As String

    sFullText = Sheets("Sheet1").Range("A1").Value
    iLength = Len(sFullText)



    For i = 1 To iLength
    sChar = Mid$(sFullText, i, 1)
    If sChar = "," Then
    iThisFoundComma = i
    iCommaCount = iCommaCount + 1
    ReDim Preserve sArray(iCommaCount)
    sArray(iCommaCount) = Mid$(sFullText, (iLastFoundComma + 1), (i - iLastFoundComma - 1))
    iLastFoundComma = i
    End If
    Next

    Dim test As String
    For i = 1 To iCommaCount
    test = test & sArray(i) & vbNewLine
    Next

    MsgBox test

    End Sub



User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com