1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
| Option Explicit
Dim Ws As Worksheet
Private Sub CommandButton1_Click()
Unload Me
End Sub
Private Sub Frame18_Click()
End Sub
Private Sub Userform_Initialize()
Set Ws = Sheets("Centralisation simple")
ComboBox2.RowSource = ("Jour")
ComboBox3.RowSource = ("Mois")
End Sub
Private Sub CommandButton2_Click()
Label1.ForeColor = RGB(0, 0, 0)
Label2.ForeColor = RGB(0, 0, 0)
Label3.ForeColor = RGB(0, 0, 0)
Label4.ForeColor = RGB(0, 0, 0)
Label18.ForeColor = RGB(0, 0, 0)
Label19.ForeColor = RGB(0, 0, 0)
Label21.ForeColor = RGB(0, 0, 0)
Label22.ForeColor = RGB(0, 0, 0)
Label23.ForeColor = RGB(0, 0, 0)
Label59.ForeColor = RGB(0, 0, 0)
Label62.ForeColor = RGB(0, 0, 0)
'Contrôles de contenu
If TextBox1.Value = "" Then 'SI pas de "nom" ...
Label1.ForeColor = RGB(255, 0, 0) 'Label "nom" en rouge
ElseIf TextBox2.Value = "" Then
Label2.ForeColor = RGB(255, 0, 0)
ElseIf ComboBox2.Value = "" Then
Label3.ForeColor = RGB(255, 0, 0)
Else
'Si formulaire est complet
Dim no_ligne As Integer
no_ligne = Range("A65536").End(xlUp).Row + 1
Cells(no_ligne, 1) = TextBox1
Cells(no_ligne, 2) = TextBox2
Cells(no_ligne, 3) = ComboBox2
Cells(no_ligne, 4) = IIf(Me.OptionButton1 = True, "Oui", "Non")
Cells(no_ligne, 4) = IIf(Me.OptionButton3 = True, "Oui", "Non")
Cells(no_ligne, 7) = IIf(Me.OptionButton5 = True, "Correcte", "Incorrecte")
Cells(no_ligne, 6) = TextBox3
Cells(no_ligne, 8) = IIf(Me.OptionButton7 = True, "Correctes", "Incorrectes")
Cells(no_ligne, 9) = IIf(Me.OptionButton9 = True, "Oui", "Non")
Cells(no_ligne, 10) = ComboBox3
Cells(no_ligne, 11) = IIf(Me.OptionButton11 = True, "Oui", "Non")
Cells(no_ligne, 12) = IIf(Me.OptionButton13 = True, "Oui", "Non")
Cells(no_ligne, 13) = IIf(Me.OptionButton15 = True, "Oui", "Non")
Cells(no_ligne, 14) = IIf(Me.OptionButton17 = True, "Oui", "Non")
Cells(no_ligne, 15) = IIf(Me.OptionButton19 = True, "Oui", "Non")
TextBox1 = ""
TextBox2 = ""
ComboBox2 = ""
TextBox3 = ""
ComboBox3 = ""
OptionButton1 = ""
OptionButton2 = ""
OptionButton3 = ""
OptionButton4 = ""
OptionButton5 = ""
OptionButton6 = ""
OptionButton7 = ""
OptionButton8 = ""
OptionButton9 = ""
OptionButton10 = ""
OptionButton11 = ""
OptionButton12 = ""
OptionButton13 = ""
OptionButton14 = ""
OptionButton15 = ""
OptionButton16 = ""
OptionButton17 = ""
OptionButton18 = ""
OptionButton19 = ""
OptionButton20 = ""
End If
End Sub |
Partager