开发者

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

开发者 https://www.devze.com 2023-01-25 18:50 出处:网络
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\").

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.


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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号