Sub begins.
Look at cells in a row along column C (trial) column D (error psn) and column E (error action).
If D="P" and E contains "Q", and C contains "nil", then write "1" in column K.
If D="P" and E contains "Q", and C does not contain "nil", then write "1" in column J.
If D="P" and E contains "R", and C contains "nil", then write "2" in column K.
If D="P" and E contains "R", and C does not contain "nil", then write "2" in column J.
If D="P" and E contains "S", and C contains "nil", then write "3" in column K.
If D="P" and E contains "S", and C does not contain "nil", then write "3" in column J.
If D="P" and E contains "T", and C contains "nil", then write "4" in column K
If D="P" and E contains "T", and C does not contain "nil", then write "4" in column J.
If D="P" and E contains "Z", and C contains "nil", then write "5" in column K.
If D="P" and E contains "Z", and C does not contain "nil", then write "5" in column J.
If D="P" and E contains "Complete_contract", and C contains "nil", then write "6" in column K.
If D="P" and E contains "Complete_contract", and C does not contain "nil", then write "6" in column J.
If D="P" and E contains "Next_order", and C contains "nil", then write "7" in column K.
If D="P" and E contains "Next_order", and C does not contain "nil", then write "7" in column J.
If D="P" and E contains "P", do nothing and continue search
If D="Q" and E contains "R", and C contains "nil", then write "1" in column K.
If D="Q" and E contains "R", and C does not contain "nil", then write "1" in column J.
If D="Q" and E contains "S", and C contains "nil", then write "2" in column K.
If D="Q" and E contains "S", and C does not contain "nil", then write "2" in column J.
If D="Q" and E contains "T", and C contains "nil", then write "3" in column K.
If D="Q" and E contains "T", and C does not contain "nil", then write "3" in column J.
If D="Q" and E contains "Z", and C contains "nil", then write "4" in column K.
If D="Q" and E contains "Z", and C does not contain "nil", then write "4" in column J.
If D="Q" and E contains "Complete_contract", and C contains "nil", then write "5" in column K.
If D="Q" and E contains "Complete_contract", and C does not contain "nil", then write "5" in column J.
If D="Q" and E contains "Next_order", and C contains "nil", then write "6" in column K.
If D="Q" and E contains "Next_order", and C does not contain "nil", then write "6" in column J.
If D="Q" and E contains "P", and C contains "nil", then write "-1" in column K.
If D="Q" and E contains "P", and C does not contain "nil", then write "-1" in column J
If D="Q" and E contains "Q", do nothing and continue search
If D="R" and E contains "S", and C contains "nil", then write "1" in column K.
If D="R" and E contains "S", and C does not contain "nil", then write "1" in column J.
If D="R" and E contains "T", and C contains "nil", then write "2" in column K.
If D="R" and E contains "T", and C does not contain "nil", then write "2" in column J.
If D="R" and E contains "Z", and C contains "nil", then write "3" in column K.
If D="R" and E contains "Z", and C does not contain "nil", then write "3" in column J.
If D="R" and E contains "Complete_contract", and C contains "nil", then write "4" in column K.
If D="R" and E contains "Complete_contract", and C does not contain "nil", then write "4" in column J.
If D="R" and E contains "Next_order", and C contains "nil", then write "5" in column K.
If D="R" and E contains "Next_order", and C does not contain "nil", then write "5" in column J.
If D="R" and E contains "Q", and C contains "nil", then write "-1" in column K.
If D="R" and E contains "Q", and C does not contain "nil", then write "-1" in column J.
If D="R" and E contains "P", and C contains "nil", then write "-2" in column K.
If D="R" and E contains "P", and C does not contain "nil", then write "-2" in column J.
If D="R" and E contains "R", do nothing and continue search
If D="S" and E contains "T", and C contains "nil", then write "1" in column K.
If D="S" and E contains "T", and C does not contain "nil", then write "1" in column J.
If D="S" and E contains "Z", and C contains "nil", then write "2" in column K.
If D="S" and E contains "Z", and C does not contain "nil", then write "2" in column J.
If D="S" and E contains "Complete_contract", and C contains "nil", then write "3" in column K.
If D="S" and E contains "Complete_contract", and C does not contain "nil", then write "3" in column J.
If D="S" and E contains "Next_order", and C contains "nil", then write "4" in column K.
If D="S" and E contains "Next_order", and C does not contain "nil", then write "4" in column J.
If D="S" and E contains "R", and C contains "nil", then write "-1" in column K.
If D="S" and E contains "R", and C does not contain "nil", then write "-1" in column J.
If D="S" and E contains "Q", and C contains "nil", then write "-2" in column K.
If D="S" and E contains "Q", and C does not contain "nil", then write "-2" in column J.
If D="S" and E contains "P", and C contains "nil", then write "-3" in column K.
If D="S" and E contains "P", and C does not contain "nil", then write "-3" in column J.
If D="S" and E contains "S", do nothing and continue search
If D="T" and E contains "Z", and C contains "nil", then write "1" in column K.
If D="T" and E contains "Z", and C does not contain "nil", then write "1" in column J.
If D="T" and E contains "Complete_contract", and C contains "nil", then write "2" in column K.
If D="T" and E contains "Complete_contract", and C does not contain "nil", then write "2" in column J.
If D="T" and E contains "Next_order", and C contains "nil", then write "3" in column K.
If D="T" and E contains "Next_order", and C does not contain "nil", then write "3" in column J.
If D="T" and E contains "S", and C contains "nil", then write "-1" in column K.
If D="T" and E contains "S", and C does not contain "nil", then write "-1" in column J.
If D="T" and E contains "R", and C contains "nil", then write "-2" in column K.
If D="T" and E contains "R", and C does not contain "nil", then write "-2" in column J.
If D="T" and E contains "Q", and C contains "nil", then write "-3" in column K.
If D="T" and E contains "Q", and C does not contain "nil", then write "-3" in column J.
If D="T" and E contains "P", and C contains "nil", then write "-4" in column K.
If D="T" and E contains "P", and C does not contain "nil", then write "-4" in column J.
If D="T" and E contains "T", do nothing and continue search
If D="Z" and E contains "Complete_contract", and C contains "nil", then write "1" in column K.
If D="Z" and E contains "Complete_contract", and C does not contain "nil", then write "1" in column J.
If D="Z" and E contains "Next_order", and C contains "nil", then write "2" in column K.
If D="Z" and E contains "Next_order", and C does not contain "nil", then write "2" in column J.
If D="Z" and E contains "T", and C contains "nil", then write "-1" in column K.
If D="Z" and E contains "T", and C does not contain "nil", then write "-1" in column J.
If D="Z" and E contains "S", and C contains "nil", then write "-2" in column K.
If D="Z" and E contains "S", and C does not contain "nil", then write "-2" in column J.
If D="Z" and E contains "R", and C contains "nil", then write "-3" in column K.
If D="Z" and E contains "R", and C does not contain "nil", then write "-3" in column J.
If D="Z" and E contains "Q", and C contains "nil", then write "-4" in column K.
If D="Z" and E contains "Q", and C does not contain "nil", then write "-4" in column J.
If D="Z" and E contains "P", and C contains "nil", then write "-5" in column K.
If D="Z" and E contains "P", and C does not contain "nil", then write "-5" in column J.
If D="post" and E contains "Next_order", and C contains "nil", then write "1" in column K.
If D="post" and E contains "Next_order", and C does not contain "nil", then write "1" in column J.
If D="post" and E contains "Z", and C contains "nil", then write "-1" in column K.
If D="post" and E contains "Z", and C does not contain "nil", then write "-1" in column J.
If D="post" and E contains "T", and C contains "nil", then write "-2" in column K.
If D="post" and E contains "T", and C does not contain "nil", then write "-2" in column J.
If D="post" and E contains "S", and C contains "nil", then write "-3" in column K.
If D="post" and E contains "S", and C does not contain "nil", then write "-3" in column J.
If D="post" and E contains "R", and C contains "nil", then write "-4" in column K.
If D="post" and E contains "R", and C does not contain "nil", then write "-4" in column J
If D="post" and E contains "Q", and C contains "nil", then write "-5" in column K.
If D="post" and E contains "Q", and C does not contain "nil", then write "-5" in column J
If D="post" and E contains "P", and C contains "nil", then write "-6" in column K.
If D="post" and E contains "P", and C does not contain "nil", then write "-6" in column J.
End sub
Also, multiple error action cells in column E can be associated with just one cell in columns C and D respectively. I need to write code to make sure that Excel can code those special cases as well.
Bookmarks