VBA错误
有人能解释一下这个编码有什么问题吗。。请注意:(Private Sub getminval_Click()
'Get Minimum Value
Dim myfile2 As Integer
Dim dblX As Variant
Dim dblY As Variant
Dim dblZ As Variant
Dim strTextLine As String
Dim min_value As Integer
Dim min As Double
Dim arrText As Variant
Dim diffZ As Variant
Dim ivalue As Double
Dim i As Integer
myfile2 = FreeFile
Open mstrinpfile For Input As #myfile2
i = 0
Do While Not EOF(myfile2) = True
Line Input #myfile2, strTextLine
arrText = Split(strTextLine, ",")
dblX(i) = arrText(0)
dblY(i) = arrText(1)
dblZ(i) = arrText(2)
Input #myfile2, dblX(i), dblY(i), dblZ(i)
ivalue = 1000
diffZ = dblZ - ivalue
If diffZ < 0 Then
min = dblZ(i)
minval.Text = Val(min)
End If
i = i + 1
Loop
End Sub
它应该通过逐个比较文件中的数据来获得最小值。。 嗨mien
在读取输入文件时尝试此语法。
Open "Your file path and filename with extension" For Input As #myfile2
如果对你有效,请告诉我。
祝你有美好的一天。。。。。 好的,谢谢。我会试着。。。。
页:
[1]