当除数为0时,除数字键外的所有键都设置为"失效",这样就能从根本上解决问题
假设除数是text5.textif val(text5.text) = 0 then msgbox "输入错误" exit subelse 做除法计算end if