x * 1 = y
x * 2 = y
x * 3 = y
x * 4 = y
x * 5 = y
x * 6 = y
x * 7 = y
x * 8 = y
x * 9 = y用户输入x 在msgbox中 显示 以上形式的输出.
怎么写~~~
x * 2 = y
x * 3 = y
x * 4 = y
x * 5 = y
x * 6 = y
x * 7 = y
x * 8 = y
x * 9 = y用户输入x 在msgbox中 显示 以上形式的输出.
怎么写~~~
Dim x, y As Double
x = InputBox("请输入x的值:", "数据输入")If IsNumeric(x) Then
For i = 1 To 9
y = CDbl(x) * i
MsgBox x & "* " & i & " =" & y
Next
Else
MsgBox "输入的不是数字!"
End If
End Sub
Dim x, y As Double
dim msgTxt as string
x = InputBox("请输入x的值:", "数据输入")If IsNumeric(x) Then
For i = 1 To 9
y = CDbl(x) * i
msgTxt = cstr(x) & "* " & i & " =" & cstr(y) & vbcrlf
Next
msgbox msgtxt
Else
MsgBox "输入的不是数字!"
End If
End Sub
这样msgbox对话框就只出现一次
x = InputBox("请输入x的值:", "数据输入")
If IsNumeric(x) Then
For i = 1 To 9
y = CDbl(x) * i
msgTxt =msgtxt & cstr(x) & "* " & i & " =" & cstr(y) & vbcrlf
Next
Else
MsgBox "输入的不是数字!"
End If
msgbox msgtxt
End Sub
用户输入x 在msgbox中 显示 以上形式的输出.
msgbox是个输出信息框,咋输入?
Dim x, y As Double, i As Integer
x = InputBox("x", "")If IsNumeric(x) Then
For i = 1 To 9
y = CDbl(x) * i
MsgBox x & "* " & i & " =" & y
Next
Else
MsgBox "not a number"
End If
End Sub
你的代码直接就输出x*9 = y了
我想要
x * 1 = y
x * 2 = y
x * 3 = y
x * 4 = y
x * 5 = y
x * 6 = y
x * 7 = y
x * 8 = y
x * 9 = y 整个在messagebox里
比如说用户输入 1在testbox
点一个按钮
然后弹出messagebox
1 * 1 = 1
1 * 2 = 2
......