Bonjour j'ai un formulaire de modification et j'aimerai pouvoir modifier mon tableau excel le problème que je veux chercher l'information selon deux colonnes car par exemple dan smon formulaire j'ai plusieurs GDO avec différents id alors que je cherche l'information selon just un seul comment faire qu'il prend en compte aussi le numéro.
Je cherche combobocodegdo et j'aimerai que cherche aussi en fonction de comboboxiD qui le numéro . car la je récupère toujours la m^me ligne
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
With Sheets("Registre PPI AFC apres visite")
    Set Cel = .Columns("F").Find(What:=Me.ComboBoxCodeGDO, LookIn:=xlValues, lookat:=xlWhole)
    If Not Cel Is Nothing Then
    ligne = Cel.Row
    If MsgBox("Voulez-vous modifier les informations de " & Me.ComboBoxCodeGDO & " ?", _
                      vbQuestion + vbYesNo, "Modification") <> vbYes Then Exit Sub
            .Range("A" & ligne).Value = ComboBoxCentre
            .Range("B" & ligne).Value = ComboBoxNomPosteSource.Value
            .Range("C" & ligne).Value = ComboBoxCodeDépartHTA.Value
            .Range("D" & ligne).Value = ComboBoxNomDépartHTA.Value
            .Range("E" & ligne).Value = ComboBoxPoleExploit.Value
            .Range("F" & ligne).Value = ComboBoxCodeGDO.Value
            .Range("G" & ligne).Value = ComboBoxPPI.Value
            .Range("H" & ligne).Value = ""
            .Range("I" & ligne).Value = ComboBoxNomPoste.Value
            .Range("J" & ligne).Value = ComboBoxCommune.Value
            .Range("K" & ligne).Value = ComboBoxTypeILD.Value
            .Range("L" & ligne).Value = ComboBoxModele.Value
            .Range("M" & ligne).Value = ComboBoxConstructeurs.Value
            .Range("N" & ligne).Value = ComboBoxTechnologie.Value
            .Range("O" & ligne).Value = ComboBoxAnneeBatterie.Value
            .Range("P" & ligne).Value = TextBoxCalibre.Value
            .Range("Q" & ligne).Value = TextBoxRéglageEffectif.Value
            .Range("R" & ligne).Value = ComboBoxRéglagePréconisé.Value
            If ComboBoxTypeILD.Value = "LDAC BT" Or ComboBoxTypeILD.Value = "LDAC Autonome" Then
            .Range("X" & ligne).Value = ComboBoxSupport1.Value
            .Range("S" & ligne).Value = ComboBoxDateControle1.Value
            .Range("Y" & ligne).Value = ComboBoxBatterie.Value
            .Range("Z" & ligne).Value = ComboBoxPlatine.Value
            .Range("AA" & ligne).Value = ComboBoxVoyant.Value
            .Range("AB" & ligne).Value = ComboBoxTorres.Value
            .Range("AC" & ligne).Value = ComboBoxPPAC.Value
            End If
            If ComboBoxTypeILD.Value = "PDAC Solaire" Or ComboBoxTypeILD.Value = "PDAC Autonome" Then
            .Range("X" & ligne).Value = ComboBoxSupport1.Value
            .Range("S" & ligne).Value = ComboBoxDateControle1.Value
            .Range("Y" & ligne).Value = ComboBoxBatterie.Value
            .Range("Z" & ligne).Value = ComboBoxPlatine.Value
            .Range("AA" & ligne).Value = ""
            .Range("AB" & ligne).Value = ""
            .Range("AC" & ligne).Value = ""
            End If
            .Range("T" & ligne).Value = ComboBoxDateValise.Value
 
             If OptionButton1 Then
            .Range("U" & ligne).Value = TextBoxNom.Value
            End If
            If OptionButton2 Then
            .Range("U" & ligne).Value = TextBoxNomAdjacent.Value
            End If
            .Range("V" & ligne).Value = ""
            .Range("W" & ligne).Value = ""
            .Range("AD" & ligne).Value = ComboBoxModificationSchémas.Value
            .Range("AE" & ligne).Value = TextBoxContenuACR.Value
            .Range("AF" & ligne).Value = TextBoxActionVisite.Value
            .Range("AG" & ligne).Value = TextBoxActionUltérieurement.Value
            If ComboBoxResultat = "Autre" Then
            .Range("AH" & ligne).Value = TextBoxCommentaire.Value
            Else
                   .Range("AH" & ligne).Value = ComboBoxResultat.Value
            End If
            .Range("AI" & ligne).Value = ComboBoxResponsable.Value
            .Range("AM" & ligne).Value = ComboBoxId.Value
            .Range("AJ" & ligne).Value = "Modification"
            .Range("AK" & ligne).Value = ComboBoxSiteOperationnel
            .Range("AL" & ligne).Value = ComboBoxAgenceExploit.Value
           Else
            modif = MsgBox("cet PPI est déjà référencée dans la base" & Chr(10) & Chr(10) & _
                    "Merci de passer par le mode Modification ou Suppression ?", vbYesNo + vbQuestion, "Demande d'enregistrement")
        If modif = vbYes Then
         End If
        If modif = vbNo Then
                End If
                End If