Have you checked the battery? If the engine is not cranking because of weak battery, then the dashboard lights will go out when you turn on the ignition. As soon as you switch off the ignition the lights will come back on.
If the dashboard lights stay on when you switch on the ignition, then 2nd possibility is faulty starter motor. Usually, you hear clicking noise but no cranking when this happens.
3rd possibility is faulty ignition switch.
Just few days ago my 2009 Honda Civic suddenly stopped working. Dashboard lights turned on, but when I switch on the ignition, the lights went out. I first thought it was weak battery, but when I checked the battery with multimeter, it showed 12.9 volts, which indicates good battery. There was corrosion on battery terminals, so I removed the connectors on terminals and cleaned the battery. The car then started without any problem. So, you should also check for corrosion on the battery.