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
|
Private Sub rechercher_Click()
Dim I As Long, NbLignes As Long
Dim Source As Worksheet
Dim Trouve As Boolean
Set Source = Sheets("DEMANDES")
Sheets("DEMANDES").Select
NbLignes = Source.Cells(Rows.Count, "B").End(xlUp).Row
For I = 1 To NbLignes
If Source.Range("B" & I) = cbo_demande.Value Then
Trouve = True
nom_complet.Value = Source.Cells(I, 3).Value
TextBox33.Value = Source.Cells(I, 4).Value
TextBox16.Value = Source.Cells(I, 5).Value
TextBox17.Value = Source.Cells(I, 6).Value
TextBox18.Value = Source.Cells(I, 7).Value
TextBox19.Value = Source.Cells(I, 8).Value
TextBox35.Value = Source.Cells(I, 9).Value
cbo_lieu_rdv.Value = Source.Cells(I, 10).Value
TextBox5.Value = Source.Cells(I, 11).Value
TextBox6.Value = Source.Cells(I, 12).Value
TextBox7.Value = Source.Cells(I, 13).Value
cbo_raison_medicale.Value = Source.Cells(I, 14).Value
cbo_priorité.Value = Source.Cells(I, 15).Value
cbo_etat_accomp.Value = Source.Cells(I, 16).Value
TextBox11.Value = Source.Cells(I, 17).Value
TextBox12.Value = Source.Cells(I, 18).Value
TextBox13.Value = Source.Cells(I, 19).Value
TextBox14.Value = Source.Cells(I, 20).Value
TextBox15.Value = Source.Cells(I, 21).Value
TextBox34.Value = Source.Cells(I, 22).Value
cbo_nom_benevole.Value = Source.Cells(I, 23).Value
TextBox21.Value = Source.Cells(I, 24).Value
TextBox22.Value = Source.Cells(I, 25).Value
TextBox23.Value = Source.Cells(I, 26).Value
TextBox24.Value = Source.Cells(I, 27).Value
TextBox25.Value = Source.Cells(I, 28).Value
TextBox26.Value = Source.Cells(I, 29).Value
TextBox27.Value = Source.Cells(I, 30).Value
cbo_confirmation_paiement.Value = Source.Cells(I, 31).Value
cbo_paiment_benevole.Value = Source.Cells(I, 32).Value
TextBox28.Value = Source.Cells(I, 33).Value
TextBox29.Value = Source.Cells(I, 34).Value
TextBox32.Value = Source.Cells(I, 35).Value
TextBox30.Value = Source.Cells(I, 36).Value
TextBox31.Value = Source.Cells(I, 37).Value
Exit For
End If
Next
If Not Trouve Then
MsgBox "Aucune donnée correspondante trouvée"
End If
Set Source = Nothing
End Sub |
Partager