It will definitely not work that way. VBA is executed by Excel. When you export a file as HTML you just get the look, but the VBA doesn't go with it. HTML also doesn't provide any functionality; if you want a web page to have behavior then you need to program it with some combination of JavaScript on the browser side plus a server-side language like PHP, Java (J2EE), etc. This is true whether you are writing HTML by hand or exporting from Excel.