In this section we look at a program for binary flash distillation to help make these statements concrete.
First, since VBA is a macro, you must enable macros.
To create a robust program, there are two conditions that we need to check for. Stepping off stages up the column, the specified feed stage may be too low. In this case, the x value will eventually become negative (try this on a McCabe-Thiele diagram). We can test for this by adding the following lines after the calculation of x in the enriching section loop.
If x < 0 Then Cells(i + 7, 4).Value = "Feed stage too low" Exit Do End If
The person running the spreadsheet will then realize that a higher feed stage location needs ...