Private Sub CommandButton1_Click()
Select Case ComboBox1.Text
Case "+"
CommandButton1.Caption = Val(TextBox1.Text) + Val(TextBox2.Text)
Case "-"
CommandButton1.Caption = Val(TextBox1.Text) - Val(TextBox2.Text)
Case "*"
CommandButton1.Caption = Val(TextBox1.Text) * Val(TextBox2.Text)
Case "/"
CommandButton1.Caption = Val(TextBox1.Text) / Val(TextBox2.Text)
End Select
End Sub
Private Sub UserForm_Initialize()
ComboBox1.AddItem "+"
ComboBox1.AddItem "-"
ComboBox1.AddItem "*"
ComboBox1.AddItem "/"
End Sub
是不是这效果