Consulting

Results 1 to 2 of 2

Thread: Populate ListBox from multiple TextBoxes

  1. #1
    VBAX Regular
    Joined
    Dec 2016
    Posts
    23
    Location

    Post Populate ListBox from multiple TextBoxes

    Hi, I am trying to populate a ListBox with rows and columns from multiple TextBoxes on the same UserForm in Word. I have 3 TextBoxes on a Userform which I would like to fill in a ListBox when I click a Button. I would like the ListBox to add a new row everytime I click the Button to add the values from the TextBoxes.

  2. #2
    VBAX Expert
    Joined
    Sep 2016
    Posts
    788
    Location
    Private Sub CommandButton1_Click()
    
        With ListBox1
            .AddItem ""
            .List(.ListCount - 1, 0) = TextBox1.Text
            .List(.ListCount - 1, 1) = TextBox2.Text
            .List(.ListCount - 1, 2) = TextBox3.Text
        End With
    
    End Sub

Tags for this Thread

Posting Permissions

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