用VBA如何显示把textbox3的值设置为textbox1+textbox2的值,并且保证1和2中间有空格?textbox2后面是回车?
2个回答
2011-11-22 · 知道合伙人软件行家
关注
展开全部
Private Sub CommandButton1_Click()
If TextBox3.Text = "" Then
TextBox3.Text = CDbl(TextBox1.Text) + CDbl(TextBox2.Text)
TextBox1.Text = ""
TextBox2.Text = ""
Else
TextBox3.Text = CDbl(TextBox1.Text) + CDbl(TextBox2.Text) + CDbl(TextBox3.Text)
End If
End Sub
If TextBox3.Text = "" Then
TextBox3.Text = CDbl(TextBox1.Text) + CDbl(TextBox2.Text)
TextBox1.Text = ""
TextBox2.Text = ""
Else
TextBox3.Text = CDbl(TextBox1.Text) + CDbl(TextBox2.Text) + CDbl(TextBox3.Text)
End If
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询