Using the If...Then Statement
Sub SimpleIfThen() Dim weeks As String weeks = InputBox("How many weeks are in a year:", "Quiz") If weeks <> 52 Then MsgBox "Try Again" End Sub