Sub s()
y = Val(InputBox("请输入年份:"))
If y Mod 4 Then
GoTo 100
ElseIf (y Mod 100) = 0 Then
If y Mod 400 Then GoTo 100
End If
MsgBox y & "年是闰年!"
Exit Sub
100
MsgBox y & "年是平年!"
End Sub
Private Sub Command1_Click()
a = Val(Text1.Text)
If (a Mod 4 = 0 And a Mod 100 <> 0) Or (a Mod 400 = 0) Then
Text2 = "是"
Else
Text2 = "否"
End If
End Sub
(如果最右下角是label1,就把 text2 改为 label1.caption