I assume you mean that you've replaced the key switch and the problem remains. If that is the case, and whapping the panel would make it work for a bit, that indicates that there is a bad connection in one of the wires going to it.
If the warning lights don't flicker and come on as normal, and the engine runs without missing or stalling, that indicates that the main 12v to the switch and wire to the distributor are ok. That leaves the wire to the starter solenoid, which could have a break near the connector where it failed from normal vibration. If it's long enough, you can cut it back and re solder another connector on it and see if that cures it.
Another wire could be run as a worst case scenario. It won't be difficult to run the wire, but it won't have the protection of the original loom so you'll have to use a lot of tie wraps to keep it out of harms way.