Sounds like your coil/igniter. When you turn the ignition to 'on' not start, you'll hear the fuel pump prime the the engine. When the check engine light turns off you should hear a click. If not than you need to replace the coil/igniter. It's probably an intermittent problem right?
Same thing happened to me when I swapped the motor in my car, worked great for a week then nothing.