J.P. Morgan interview question

Had to code in vba on a mini simulation