excel中VBA textbox换行问题。

2024-11-28 20:56:21
推荐回答(2个)
回答1:

创建TextBox1 和CommandButton1
sub CommandButton1_Click()
dim n as integer
dim str as string
n=sheets(1).usedrange.rows.count+1
str=textbox1.text
sheets(1).cells(n,1)=str
end sub

回答2:

sub CommandButton1_Click()

dim n as integer

dim str as string

n=sheets(1).range("a65536").end(xlup).row+1

str=textbox1.text

sheets(1).cells(n,1)=str

end sub