PrivateSubCommand1_Click()DimscoreAsIntegerClsL:score=Val(InputBox("請輸入分數",,0)
)Ifscore<0Orscore>100ThenMsgBox"請輸入0~100之間的分數"GoToLEndIfIfscore<=59ThenPrint"不及格"Ifscore>=60Andscore<=69ThenPrint"及格"Ifscore>=70Andscore<=79ThenPrint"中"Ifscore>=80Andscore<=89ThenPrint"良"Ifscore>=90Andscore<=100ThenPrint"優"Endsub