• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Populate textbox's from Listbox.

You need to give a bit more detail.

What action should move over names to textbox? And what should control to which box the names are moved to? etc.
 
Hi Chihiro
Cmdbutton3 should move name to Textbox1 then Textbox2 Etc, Single selection of name and a check to ensure all 10 Textbox's are full.
 
Something like below. Remember to set MultiSelect property for ListBox to "0 - fmMultiSelectSingle".

Code:
Private Sub CommandButton3_Click()
Dim iPlist As Integer
Dim nCont As Control

With Me.ListBox1
    For iPlist = 0 To .ListCount - 1
        If .Selected(iPlist) = True Then
            For Each nCont In Me.Controls
                If TypeName(nCont) = "TextBox" Then
                    If Len(nCont.Value) = 0 Then
                        nCont.Value = .List(iPlist)
                        Exit Sub
                    End If
                End If
            Next nCont
        End If
    Next iPlist
End With
End Sub
 

Attachments

  • Input Players.xlsm
    56 KB · Views: 4
Back
Top