Forum Discussion
Excel
Aug 10, 2022Iron Contributor
Query related to Userform
Hello Everyone, I have written VBA code in Append Text to Row Button : I want the vba code in the user form to be able to loop through a selected range (A4:A14) ,in which the code s...
HansVogelaar
Aug 10, 2022MVP
I made the text box multi-line and set it to create a new line when you press Enter.
Private Sub CommandButton1_Click()
Dim i As Variant
Dim rowcounter As Long
rowcounter = Cells(Rows.Count, 1).End(xlUp).Row
For Each i In Split(Me.TextBox1, vbCrLf)
rowcounter = rowcounter + 1
Cells(rowcounter, 1).Value = i
Next i
Me.TextBox1 = ""
End Sub