你只要将代码拷到窗体就行了,其它就是运行了,简单吧 Private Sub Form_Load() Dim A As Double Dim B As Double Dim C As Double A = Val(InputBox("输入A的值:", "数据输入")) B = Val(InputBox("输入B的值:", "数据输入")) C = Val(InputBox("输入c的值:", "数据输入")) Dim D D = ((A - 0.3) * (B - 3) * (C - 15)) / ((7.5 - 0.3) * (68 - 3) * (270 - 15)) MsgBox Format(D, "0.00") End Sub
调用下calc吧。加点sendkey。
Dim D
D = ((Val(Text1) - 0.3) * (Val(Text2) - 3) * (Val(Text3) - 15)) / ((7.5 - 0.3) * (68 - 3) * (270 - 15))
Text4 = Format(D, "0.00")
End SubPrivate Sub Form_Load()
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
End Sub
Private Sub Form_Load()
Dim A As Double
Dim B As Double
Dim C As Double
A = Val(InputBox("输入A的值:", "数据输入"))
B = Val(InputBox("输入B的值:", "数据输入"))
C = Val(InputBox("输入c的值:", "数据输入"))
Dim D
D = ((A - 0.3) * (B - 3) * (C - 15)) / ((7.5 - 0.3) * (68 - 3) * (270 - 15))
MsgBox Format(D, "0.00")
End Sub
只是lz 不会竟然敢接活......
http://download.csdn.net/detail/txzsp/3781512