add in listbox multiple text as in a column from a sheet

Important Notice

Please note that on 14th December 2023 users will experience an expected outage whilst we make upgrades to our network. We anticipate this process may take a couple of hours and so we apologise in advance for any inconvenience.

  • Hi all,

    I'm trying to use a listbox in excel userform as of it was a column in the sheet and put multiple lines of text.
    Is there a way to do this, or is there another active x control that I can use? I saw the excel active x control, but it will not work out. I need to be able to enter text in it like in a colmn.
    It will be used to later run a loop and step one by one text in the control.
    I know I could use text box place one under the other, but, I would not be able then to paste text in it taken from an excel sheet.

    Any idea on how to bypass this or make it work would be nice.


  • Re: add in listbox multiple text as in a column from a sheet

    Hi all,

    I managed to solve it. I use a text box that I add the multiple line and then some code to split it up.
    Just see below code:

    Private Sub CommandButton1_Click()
    Dim strText() As String
    Dim i As Long
        strText = Split(TextBox1.Text, Chr(13))
        For i = 0 To UBound(strText)
            'Do something with strText(i)
            Debug.Print strText(i)
        Next i
    End Sub

    I hope this will be helpful to others.


Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!