If Password="iloveu" then 'If then else endif 結構
Msgbox=("歡迎使用BMI計算器")
'此處置入BMI計算器程式碼
Else
Msgbox=("抱歉!密碼錯誤")
End if
End Sub
如何知道使用者在InputBox按下Cancle鈕呢?
小提示 當我們在InputBox按下Cancle鈕時,他會傳回空字串,如: If MyStr = "" Then MsgBox "你按了Cancle按鈕"