Consulting

Results 1 to 5 of 5

Thread: Multi-choice of the listbox to many controls(textbox)

  1. #1
    VBAX Newbie
    Joined
    Jan 2011
    Posts
    3
    Location

    Multi-choice of the listbox to many controls(textbox)

    hi all
    Can transfer, multi-choice of a listbox to me.controls("I") (24 textbox)
    In other words textbox1= listbox.value+listbox.value+listbox.value+listbox.value
    The result of their appearance in textbox (en+sr+1+dd)
    Attached Files Attached Files

  2. #2
    VBAX Expert Leith Ross's Avatar
    Joined
    Oct 2012
    Location
    San Francisco, California
    Posts
    552
    Location
    Hello mido21,

    This code worked for me.

    UserForm1 Code
    Private Sub ListBox1_Change()
    
    
        Dim a As Integer
        
            a = ListBox1.ListIndex
            
            For d = 1 To 23
                If Me.Controls("i" & d).Text = "" Then
                    Me.Controls("i" & d).Text = CStr(ListBox1.List(a))
                Else
                    Me.Controls("i" & d).Text = Me.Controls("i" & d).Text + "," + CStr(ListBox1.List(a))
                End If
            Next d
            
    End Sub
    
    
    Private Sub UserForm_Initialize()
            ListBox1.List = Sheets("data").Range("a2:a20").Value
    End Sub
    Sincerely,
    Leith Ross

    "1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG"

  3. #3
    VBAX Newbie
    Joined
    Jan 2011
    Posts
    3
    Location

    Angry hello Leith Ross

    hello Leith Ross
    The code works correctly on each it is worth all controls once one
    I want the code is a single one

  4. #4
    VBAX Expert Leith Ross's Avatar
    Joined
    Oct 2012
    Location
    San Francisco, California
    Posts
    552
    Location
    Hello mido21,

    Sorry, I don't understand. Can you provide an example?
    Sincerely,
    Leith Ross

    "1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG"

  5. #5
    VBAX Newbie
    Joined
    Jan 2011
    Posts
    3
    Location
    hello Leith Ross
    The code now write in all controls("I") textbox - In the selection of listbox
    But what I need is registration in the i1 and i2 and i3
    I thought I enter code within the comndbotton

Posting Permissions

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