Copie o código abaixo:
Dim acertos As Integer
Dim erros As Integer
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
pc = Int(Rnd() * 5) + 1
Text2 = pc
vc = Val(Text1.Text)
If pc = vc Then
acertos = acertos + 1
Label2.Caption = acertos
Else
erros = erros + 1
Label3.Caption = erros
End If
End If
Text1.Text = ""
End Sub