If you just want to pick through the array then this may be cleanerCode:ForReading1 = 1 Dim i, blnFound 'Create the file system object Set fso = CreateObject("Scripting.FileSystemObject") 'Initialize a few items strSource = "F:\Am\EXCEL.CSV" 'Open the source file to read it Set ts = fso.OpenTextFile(strSource,ForReading1) 'Read the file line by line Do while not ts.AtEndOfStream strLine = ts.ReadLine 'Remove the quotes from the string strLine = Replace(strLine, Chr(34), "") 'Split the line on the comma into an array strValues = Split(strLine, ",") 'Check if the dq number matches For i = 17 to 24 If strValues(i) = dqNumber Then 'Get the other values you need soNumber = strValues(0) setNumber = strValues(2) sideNumber = strValues(4) 'Set flag that say the value was found blnFound = True 'Exit the loop Exit For End If Next If blnFound then Exit Do Loop 'Close the file ts.Close




Reply With Quote