Waller
Waller

Reputation: 1873

How to make a multi-line text box fill in different rows[EXCEL]

I have a multi-line text box in Excel. I have linked this text box with a cell, for example we will say this is linked with cell("A1").

EXAMPLE: I enter "Hello" into the multi-line text box and press ENTER. This will write "HELLO" into cell("A1"). I then type, "World" into the text box and hit ENTER again. I would like this to write "World" into the cell("A2").

Can anybody explain the best way of doing this please?

Thanks, James.

Upvotes: 1

Views: 2497

Answers (1)

Dr. belisarius
Dr. belisarius

Reputation: 61046

Remove the link to the cell and try this:

Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)


    If KeyCode = 13 Then

        Sheet1.Range("IV1").End(xlToLeft).Offset(0, 1) = TextBox1

        TextBox1 = vbNullString

    End If
End Sub

alt text

Upvotes: 1

Related Questions