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
| Private Sub CommandButton3_Click()
Dim no_ligne As Integer
Dim Ctrl As Control
Dim typeContrat As String, echelle As String, natureTrajet As String
no_ligne = ComboBox2.ListIndex + 6
TextBox1.Value = Cells(no_ligne, 2).Value
TextBox2.Value = Cells(no_ligne, 3).Value
TextBox3.Value = Cells(no_ligne, 6).Value
TextBox9.Value = Cells(no_ligne, 9).Value
TextBox5.Value = Cells(no_ligne, 10).Value
TextBox19.Value = Cells(no_ligne, 11).Value
TextBox8.Value = Cells(no_ligne, 17).Value
TextBox12.Value = Cells(no_ligne, 24).Value
TextBox13.Value = Cells(no_ligne, 25).Value
TextBox10.Value = Cells(no_ligne, 20).Value
TextBox11.Value = Cells(no_ligne, 23).Value
Cells(no_ligne, 27) = TextBox15.Value
ComboBox1.Value = Cells(no_ligne, 4).Value
typeContrat = Cells(no_ligne, 5).Value
echelle = Cells(no_ligne, 8).Value
natureAccident = Cells(no_ligne, 20).Value
For Each Ctrl In UserForm1.Controls
If TypeName(Ctrl) = "OptionButton" Then
If Ctrl.Caption = typeContrat Or Ctrl.Caption = echelle Or Ctrl.Caption = natureAccident Then
Ctrl = True
End If
End If
Next
End Sub |
Partager