J.P. Morgan Interview Question

Had to code in vba on a mini simulation