Arduino MEGA2560 code stops after power down and up

Thanks! So I am trying to add the Arduino mega 2560 to a system that has an on/off button, and I want the Arduino to keep running from its previous point after the power is turned back on. If I hold down the reset button during upload, with this allow me to cut the power and turn it back on and the sketch to just continue where it left off?