first I would drive to local abandoned business to avoid embarrassment. Just kidding. Next time this happens (I hate electrical problems that come and go) try "wiggling" the shift selector back and forth in park while you hold the key in the start position. Push it up a bit or pull back and hold and try. Then with the e-brake on try it in neutral. See if that affects it. If it does in more than likely is the neutral lockout switch on the side of the tranny. It can be adjusted and is a fairly easy replace. It controls you backup lights and allows the car to only start in neutral or park.
Next the small post closest on the solenoid is the trigger wire (red with a small blue tracer, the other wire is brown) for the starter solenoid. If wiggling the shifter does not make it start, this takes two people. If you have a simple light and probe for electrical testing or a volt ohm meter you are set. Have your lovely wife assume the driver seat and you go out under the hood. Test your light or volt ohm meter on the battery to ensure it works or is on the proper scale. Now hold the probe on the nut on the post of the above mentioned solenoid. Ask lovely wife to turn key to start position. If it starts of course the car just hates you for some other event where you called it names.
If the car does not start and you have 12 volts on that post, then you have more than likely eliminated the ignition and the neutral lock out switch. A solenoid replacement is in order as Neil indicated. Have lovely wife turn release key from start and then engage a couple times. Got power at solenoid every time, then you should replace solenoid. Sometimes the wire connector that pushes onto the post is a bit loose or corroded may try gently crimping wire connector with a needle nose to get a better connection. Gently!!! Take wire off post and hold probe in it. If you get 12 volts consistently, then replace solenoid.
I would make a couple trips to try to duplicate the situation with you arriving back in your garage. Of course it will always work in your drive way..... Good luck!!!!
Rob