求助vb高手,自己是个新手,怎样读取excell文件或data文件,将文件中的数据进行方差分析。下面是我的方差程序(只不过是输数的),帮我改一下,谢谢。
Dim n As IntegerDim data() As Single
Dim i As Integer
Dim even As Single
Dim ConV As Single
n = CInt(Val(InputBox("请输入你要计算的数据的个数:")))
even = 0
ConV = 0
If n >= 1 Then
ReDim data(n) As Single
For i = 1 To n
data(i) = Val(InputBox("请输入第" & i & "个数据(共" & n & "个):"))
even = even + data(i)
ConV = ConV + data(i) ^ 2
Next
even = even / n
ConV = ConV / n
ConV = ConV - even ^ 2
If Mid(ConV, 1, 1) = "." Then
MsgBox "这" & n & "个数的方差为:0" & ConV
Else
MsgBox "这" & n & "个数的方差为:" & ConV
End If
Else
MsgBox "输入的个数有误,请正确输入在计算!"
End
End If
End Sub
补充:VB , 非技术类