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
| Private Sub ComboBox1_Change()
Ligne = Application.Match(Me.ComboBox1.Value, [A:A], 0)
If Ligne > 36 Then
Me.OptionButton5.Visible = False
Me.Label7.Visible = False
Me.Label9.Visible = True
Me.Label10.Visible = True
Me.Label2.Caption = "Bien"
Me.Label4.Caption = "Moyen"
Me.Label5.Caption = "Bien"
Me.Label6.Caption = "Moyen"
Me.OptionButton1.GroupName = 2
Me.OptionButton2.GroupName = 2
Else
Me.OptionButton5.Visible = True
Me.Label7.Visible = True
Me.Label9.Visible = False
Me.Label10.Visible = False
Me.Label2.Caption = "18/20"
Me.Label4.Caption = "15/20"
Me.Label5.Caption = "10/20"
Me.Label6.Caption = "5/20"
Me.OptionButton1.GroupName = 1
Me.OptionButton2.GroupName = 1
End If
End Sub
Private Sub CommandButton1_Click()
Dim Ligne As Integer
If Me.ComboBox1.ListIndex > -1 Then
If Me.OptionButton1 = False And Me.OptionButton2 = False And Me.OptionButton3 = False _
And Me.OptionButton4 = False And Me.OptionButton5 = False Then
MsgBox "Choisissez une note"
Unload Me
Exit Sub
End If
Ligne = Application.Match(Me.ComboBox1.Value, [A:A], 0)
If Ligne > 36 Then
For i = 1 To 4
If Me.Controls("OptionButton" & i) = True Then
Cells(Ligne, 1).Offset(, i) = Cells(Ligne, 1).Offset(, i) + 1
End If
Next i
Else
For i = 1 To 5
If Me.Controls("OptionButton" & i) = True Then
Cells(Ligne, 1).Offset(, i) = Cells(Ligne, 1).Offset(, i) + 1
Exit For
End If
Next i
End If
[D42] = [D42] + 1
If Me.TextBox2 <> "" Then
Cells(Rows.Count, 1).End(xlUp).Offset(1) = Me.TextBox2
End If
Me.TextBox2 = ""
For i = 1 To 5
Me.Controls("OptionButton" & i) = False
Next i
Else
Unload Me
End If
End Sub
Private Sub CommandButton2_Click()
Unload Me
End Sub
Private Sub UserForm_Activate()
Dim c As Range
Me.ComboBox1.Clear
For Each c In [A7:A40]
If Left(c, 2) <> "Le" And Left(c, 2) <> "L'" Then
If c.Value <> "" Then Me.ComboBox1.AddItem c.Value
End If
Next c
Me.ComboBox1.ListIndex = 0
Me.Label9.Visible = False
Me.Label10.Visible = False
Me.Label7.Visible = True
For i = 1 To 5
Me.Controls("OptionButton" & i).GroupName = 1
Next i
End Sub |