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 96 97 98 99 100 101 102
| Private Sub UserForm_Initialize()
OptionButton1.Value = True
ComboBox1.RowSource = ("Listeélèves")
ComboBox1 = ComboBox1.List(0)
End Sub
Private Sub ComboBox1_Change()
Set C = Columns("A").Find(ComboBox1.Value, Range("A1").End(xlDown), xlValues, xlWhole)
If Not C Is Nothing Then
' j'initialise les valeurs selon choix dans la liste déroulante
TextBox7.Value = C.Offset(0, 2).Value
TextBox8.Value = C.Offset(0, 3).Value
TextBox9.Value = C.Offset(0, 4).Value
TextBox10.Value = C.Offset(0, 5).Value
TextBox11.Value = C.Offset(0, 6).Value
TextBox12.Value = C.Offset(0, 7).Value
TextBox13.Value = C.Offset(0, 1).Value
Set D = Sheets("Bilan DS").Columns("A").Find(ComboBox1.Value, Range("A1").End(xlDown), xlValues, xlWhole)
TextBox14.Value = D.Offset(0, 1).Value
End If
End Sub
Private Sub CommandButton14_Click()
Dim Reponse As String, firstAddress As String, Texte As String
Dim C As Range
Set C = Columns("A").Find(ComboBox1.Value, Range("A1").End(xlDown), xlValues, xlWhole)
If Not C Is Nothing Then
' MsgBox ("trouvé en " & C.Address & " !")
C.Offset(0, 2).Value = TextBox7.Value
C.Offset(0, 3).Value = TextBox8.Value
C.Offset(0, 4).Value = TextBox9.Value
C.Offset(0, 5).Value = TextBox10.Value
C.Offset(0, 6).Value = TextBox11.Value
C.Offset(0, 7).Value = TextBox12.Value
TextBox7.Value = ""
TextBox8.Value = ""
TextBox9.Value = ""
TextBox10.Value = ""
TextBox11.Value = ""
TextBox12.Value = ""
TextBox13.Value = C.Offset(0, 1).Value
Set D = Sheets("Bilan DS").Columns("A").Find(ComboBox1.Value, Range("A1").End(xlDown), xlValues, xlWhole)
TextBox14.Value = D.Offset(0, 1).Value
End If
End Sub
Private Sub OptionButton1_Click()
Sheets("Exercice I").Select
For i = 3 To 8
If Cells(3, i) = "" Then
Controls("Textbox" & i + 4).Enabled = False
Else
Controls("Textbox" & i + 4).Enabled = True
End If
Next i
Set C = Columns("A").Find(ComboBox1.Value, Range("A1").End(xlDown), xlValues, xlWhole)
If Not C Is Nothing Then
' j'initialise les valeurs
TextBox7.Value = C.Offset(0, 2).Value
TextBox8.Value = C.Offset(0, 3).Value
TextBox9.Value = C.Offset(0, 4).Value
TextBox10.Value = C.Offset(0, 5).Value
TextBox11.Value = C.Offset(0, 6).Value
TextBox12.Value = C.Offset(0, 7).Value
TextBox13.Value = C.Offset(0, 1).Value
End If
End Sub
Private Sub OptionButton2_Click()
Sheets("Exercice II").Select
For i = 3 To 8
If Cells(3, i) = "" Then
Controls("Textbox" & i + 4).Enabled = False
Else
Controls("Textbox" & i + 4).Enabled = True
End If
Next i
Set C = Columns("A").Find(ComboBox1.Value, Range("A1").End(xlDown), xlValues, xlWhole)
If Not C Is Nothing Then
' j'initialise les valeurs
TextBox7.Value = C.Offset(0, 2).Value
TextBox8.Value = C.Offset(0, 3).Value
TextBox9.Value = C.Offset(0, 4).Value
TextBox10.Value = C.Offset(0, 5).Value
TextBox11.Value = C.Offset(0, 6).Value
TextBox12.Value = C.Offset(0, 7).Value
TextBox13.Value = C.Offset(0, 1).Value
End If
End Sub |
Partager