1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | Dim age, w, h As Integer Dim n As String Private Sub Form_Load() Msg_value = MsgBox("男性?", vbYesNo) If Msg_value = vbYes Then MsgBox "男" Else MsgBox "女" End If n = InputBox("請輸入姓名", "基本資料", "胡琬玲") age = InputBox("請輸入年齡", "基本資料", "19") w = InputBox("請輸入身高", "基本資料", "156") h = InputBox("請輸入體重", "基本資料", "50") Msg_value = MsgBox("w/((h/100)^2", vbYesNo) MsgBox "16.0256412564", vbOKOnly, "結果" End Sub |
Direct link: https://paste.plurk.com/show/wfNUKZmctfrf5OQrneml