Filtering file input

Situation: 

You have a data file and want to process just some of the data.

Actions: 

Use a loop to read data from the file. Use an If statement to select data you want to process.

Explanation: 

Flowchart

Example:

  1. 'Open data file for input.
  2. Open ThisWorkbook.Path & "\sales.txt" For Input As #1
  3. Do While Not EOF(1)
  4.     Input #1, sale
  5.     If sale > 100 Then
  6.         'Do something.
  7.     End If
  8. Loop
  9. 'Close.
  10. Close #1