Bonjour,

j'ai un prb avec des comboBox

Explication:
j'ai 2 comboBox et je voudrais que la modification de l'une change l'autre.

prb:
comme l'une change l'autre puis que l'autre change l'une puis que l'une...

est-ce qu'il y a une maniere de garder la fonction sans que je fasse tout bugger?

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
Private Sub ComboBox_code_Change()
Dim k As Integer, nb_lignes As Integer, Code As String
 
Code = ComboBox_code
nb_lignes = WorksheetFunction.CountA(Sheets("DATOS").Range("A:A"))
 
ComboBox_choixfrs.Value = ""
For k = 2 To nb_lignes
 
    If Sheets("DATOS").Range("A" & k).Value = Code Then
        ComboBox_choixfrs.Value = Sheets("DATOS").Range("B" & k).Value
    End If
Next
 
End Sub
 
Private Sub ComboBox_choixfrs_Change()
Dim l As Integer, nb_lign As Integer, Nomfr As String
 
Nomfr = ComboBox_choixfrs
nb_lign = WorksheetFunction.CountA(Sheets("DATOS").Range("B:B"))
 
ComboBox_code.Value = ""
For l = 2 To nb_lign
 
    If Sheets("DATOS").Range("B" & l).Value = Nomfr Then
        ComboBox_code.Value = Sheets("DATOS").Range("A" & l).Value
    End If
Next
 
End Sub
merci de votre aide