Private Sub Text1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer) If KeyCode = 13 Then Select Case Val(Text1.Text) Case Is nb_a_trouver: Label1.Caption "gagné" Case Is > nb_a_trouver: Label1.Caption = "trop grand" Case Else: Label1.Caption = "trop petit" End Select KeyCode = 0 Text1.Text = "" End If End Sub
Quelques mots de remerciements seront grandement appréciés. Ajouter un commentaire
202 internautes nous ont dit merci ce mois-ci
existe t'il sous Excel ou Flash
a_trouver = Int((50000 * Rnd) + 1)
Private nb_a_trouver As Long Private Sub Command1_Click() Randomize nb_a_trouver = Int((50000 * Rnd) + 1) Text1.Text = "" End Sub Private Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then Select Case Val(Text1.Text) Case Is nb_a_trouver: Label1.Caption "gagné" Case Is > nb_a_trouver: Label1.Caption = "trop grand" Case Else: Label1.Caption = "trop petit" End Select KeyAscii = 0 Text1.Text = "" End If End Sub
Et après j'ai encore raté une gare ou un continent?