Private Sub Command1_Click()
Dim s As Integer
s = Text1.Text
If s Mod 3 = 0 Then x = MsgBox("是3的倍数", vbOKOnly, "数值判断")
Else: If s Mod 3 <> 0 Then x = MsgBox("不是3的倍数", vbOKOnly, "数值判断")
End If
End Sub
反正就是不能执行
...全文
1094打赏收藏
这段代码哪里错了?谢谢
Private Sub Command1_Click() Dim s As Integer s = Text1.Text If s Mod 3 = 0 Then x = MsgBox("是3的倍数", vbOKOnly, "数值判断") Else: If s Mod 3 0 Then x = MsgBox("不是3的倍数", vbOKOnly, "数值判断") End If End Sub 反正就是不能执行
Private Sub Command1_Click()
Dim s As Integer
s = Text1.Text
If s Mod 3 = 0 Then x = MsgBox("是3的倍数", vbOKOnly, "数值判断")
If s Mod 3 <> 0 Then x = MsgBox("不是3的倍数", vbOKOnly, "数值判断")
End Sub
这样就可以了
Private Sub Command1_Click()
Dim s As Integer
s = Text1.Text
If s Mod 3 = 0 Then
x = MsgBox("是3的倍数", vbOKOnly, "数值判断")
Else
If s Mod 3 <> 0 Then
x = MsgBox("不是3的倍数", vbOKOnly, "数值判断")
End If
End If
End Sub