mien Posted August 26, 2009 Posted August 26, 2009 can someone explain to me what wrong with this coding..pls:( 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 it should get minimum value by compare one by one data in the file.. Quote
giskumar Posted August 27, 2009 Posted August 27, 2009 Hi mien Try this syntax while reading the input file. Open "Your file path and filename with extension" For Input As #myfile2 let me know if it works for you. Have a great day..... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.