|
用vb6做了个卡方计算器,就是照着这个网页做的:blog.sina.com.cn/s/blog_974139980100v6ar.ht ml (去掉空格)
结果发现vb里面没有CHITEST函数,请问如何弄?
另外,我有一个rc.exe小程序想嵌入到我做的软件里,怎么也搞不好,到别人电脑释放不出来,如果会也帮我整一下,或者告诉我步骤和代码也行,谢谢!
附上计算器代码:
Private Sub 计算_Click()
On Error GoTo 1
Text5.Text = Val(Text1.Text) + Val(Text3.Text)
Text6.Text = Val(Text2.Text) + Val(Text4.Text)
Text7.Text = Val(Text1.Text) + Val(Text2.Text)
Text8.Text = Val(Text3.Text) + Val(Text4.Text)
Text9.Text = Val(Text5.Text) + Val(Text6.Text)
Text10.Text = Text5.Text * Text7.Text / Text9.Text
Text11.Text = Text6.Text * Text7.Text / Text9.Text
Text12.Text = Text5.Text * Text8.Text / Text9.Text
Text13.Text = Text6.Text * Text8.Text / Text9.Text
Text14.Text = Val(Text10.Text) + Val(Text12.Text)
Text15.Text = Val(Text11.Text) + Val(Text13.Text)
Text16.Text = Val(Text10.Text) + Val(Text11.Text)
Text17.Text = Val(Text12.Text) + Val(Text13.Text)
Text18.Text = Val(Text14.Text) + Val(Text15.Text)
a = (Val(Text1.Text) - Val(Text10.Text)) * (Val(Text1.Text) - Val(Text10.Text)) / Val(Text10.Text)
b = (Val(Text2.Text) - Val(Text11.Text)) * (Val(Text2.Text) - Val(Text11.Text)) / Val(Text11.Text)
C = (Val(Text3.Text) - Val(Text12.Text)) * (Val(Text3.Text) - Val(Text12.Text)) / Val(Text12.Text)
d = (Val(Text4.Text) - Val(Text13.Text)) * (Val(Text4.Text) - Val(Text13.Text)) / Val(Text13.Text)
Text19.Text = a + b + C + d
Application.WorksheetFunction.range("A1").Value = Val(Text1.Text)
Application.WorksheetFunction.range("b1").Value = Val(Text2.Text)
Application.WorksheetFunction.range("A2").Value = Val(Text3.Text)
Application.WorksheetFunction.range("b2").Value = Val(Text4.Text)
Application.WorksheetFunction.range("A3").Value = Val(Text10.Text)
Application.WorksheetFunction.range("b3").Value = Val(Text11.Text)
Application.WorksheetFunction.range("A4").Value = Val(Text12.Text)
Application.WorksheetFunction.range("b4").Value = Val(Text13.Text)
Text20.Text = Application.WorksheetFunction.CHITeST(Application.WorksheetFunction.range("A1:b2"), Application.WorksheetFunction.range("A3:b4"))
Exit Sub
1:
MsgBox "请输入正确数据", , "出错啦
End Sub
|
|