Aug 10 2022 02:52 AM - edited Aug 10 2022 03:30 AM
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 starts from row A4 but i dont know how to make the code more dynamic so that once someone types text in the textbox and appends the text to the new rows , its offsets to the row underneath it.
Please help.
Here is a attached file.
Aug 10 2022 03:33 AM - edited Aug 10 2022 03:34 AM
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