User Form - Show Multilines

barissh

Board Regular
Joined
Aug 10, 2006
Messages
94
I have a userform. I'm getting some info and write all this infos to column A
down by down... and there is another text box which is reading all infos
in column A. But I don't know how to show all info down by down as inserted
in column A. I already changed textbox MultiLine as True. Please tell me
how can I insert all info with makro into textbox down by down as column A.
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Example:

Code:
Private Sub UserForm_Initialize()
    Dim Cell As Range
    For Each Cell In Worksheets("Sheet1").Range("A1:A3")
        TextBox1.Text = TextBox1.Text & Cell.Value & Chr(10)
    Next Cell
End Sub
 
Upvote 0
Hi,

Try a listbox, sample code which assumes you have a listbox control named 'Listbox1' and sheet1 contains the data with a heading in cell A1 is:
Code:
Private Sub UserForm_Activate()
Dim lRowEnd As Long
Dim WS As Worksheet

Set WS = Sheets("Sheet1")
lRowEnd = WS.Cells(Rows.Count, "A").End(xlUp).Row
With ListBox1
    .Clear
    .ColumnCount = 1
    .ColumnHeads = True
    .RowSource = "='" & WS.Name & "'!" & "A2:A" & lRowEnd
End With
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,212
Messages
6,123,656
Members
449,114
Latest member
aides

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top