Option Explicit
Sub test()
Dim x As Integer, y As Integer, confirm As Integer
'initialise le générateur de nombre aléatoire
Randomize
x = Int(Rnd * 50)
'une boucle pour éviter l'égalité
Do
y = Int(Rnd * 50)
Loop While y = x
confirm = MsgBox(IIf(x > y, x & " est supérieur à " & y & " ?", x & " est inférieur à " & y & " ?"), vbYesNo)
If confirm = 6 Then MsgBox "Gagné !!!" Else MsgBox "Perdu !!!"
End Sub