Private Sub CommandButton1_Click()
Dim c As Control, i%, j%
For Each c In Me.Controls
If TypeName(c) = "TextBox" Then
Select Case c.Tag * 1 Mod 2
Case 0
a = Len(c) > 0: i = i + a
Case 1
b = Len(c) > 0: j = j + b
End Select
End If
Next
If i = -1 Or j = -1 Then MsgBox "Données erronées", vbCritical, "Erreur!"
End Sub