Private Sub CommandButton1_Click()
Dim CTRL As Control
Dim x As Byte
For Each CTRL In Me.Controls
For x = 1 To 7
If CTRL.Name = "TextBox" & x Then
If CTRL.Value = "" Then
MsgBox "La " & CTRL.Name & " est vide !", vbCritical, "Y à pas bon !"
Exit Sub
End If
If IsNumeric(CTRL.Value) = False Then
MsgBox "La " & CTRL.Name & " ne contient pas une valeur numérique !" & vbCrLf & CTRL.Value, vbCritical, "Encore pas bon !!!!!"
CTRL.Value = ""
CTRL.SetFocus
Exit Sub
End If
End If
Next x
Next CTRL
End Sub