Add DVWP using SharePoint designer.
DVWP is binding data to MyTable. If your table name is different, please change the table name in the below script.
So that is the key to export data in to excel.
Open your page using browser.
Click Edit page.
Add content editor web part.
Now Edit content editor web part.
Click on "Source Editor.."
Copy below code and paste.