Re : [VBA] triple combobox
Je viens d'installer un Excel 2003 sur un de mes PC de manière à faire des tests, et donc je peut affiner mon problème principale.
Voici mon code et en Rouge les lignes qui bug avec le message "Erreur de compilation : Projet ou Bibliothèque introuvable" :
Dim F As Worksheet
Dim c, Mondico
Dim Ligne1, Ligne2 As Range
Dim recherche As String
Private Sub CommandButton4_Click()
Unload Me
End Sub
Private Sub SN_Click()
Dim Cel As Range
DT.Clear
For Each Cel In Ligne1
If Cel Is Nothing Then Exit Sub
If Cel = Ligne1.Find(SN) Then
DT.AddItem Cel.Offset(0, 1)
End If
Next Cel
End Sub
Private Sub Userform_Initialize()
Set F = Worksheets("UUT")
Set Ligne1 = F.Range("b3", F.Range("b65536").End(xlUp))
Set Ligne2 = F.Range("c3", F.Range("c65536").End(xlUp))
Set Mondico = CreateObject("Scripting.Dictionary")
For Each c In Range(F.[A3], F.[A800].End(xlUp))
If c.Value <> "" Then Mondico.Item(c.Value) = c.Value
Next c
Me.PN.List = Mondico.items
End Sub
Private Sub DT_Change()
Dim Cel As Range
recherche = Format(DT.Value, "m/d/yyyy")
Set Cel = Ligne2.Find(recherche)
If Cel Is Nothing Then Exit Su
With Cel
NNO = .Offset(0, 1)
DSN = .Offset(0, 2)
MDP = .Offset(0, 3)
AR = .Offset(0, 4)
HH = .Offset(0, 5)
FS = .Offset(0, 6)
IC = .Offset(0, 7)
End With
End Sub
Private Sub PN_Change()
If Me.PN <> "" Then
Me.SN.Clear
Me.DT.Clear
'Me.TextBox1 = ""
Set Mondico = CreateObject("Scripting.Dictionary")
For Each c In Range(F.[A3], F.[A800].End(xlUp))
If c = Me.PN And c.Offset(, 1).Value <> "" Then
Mondico.Item(c.Offset(, 1).Value) = c.Offset(, 1).Value
End If
Next c
Me.SN.List = Mondico.items
End If
End Sub
'Modifier les données des Textboxs
Private Sub CommandButton2_Click()
Dim Cel As Range
DT.Value = Format(DT.Value, "m/d/yyyy")
Set Cel = Ligne2.Find(DT)
If Cel Is Nothing Then MsgBox "rien": Exit Sub
With Cel
.Offset(0, 1) = NNO
.Offset(0, 2) = DSN
.Offset(0, 3) = MDP
.Offset(0, 4) = AR
.Offset(0, 5) = HH
.Offset(0, 6) = FS
.Offset(0, 7) = IC
End With
Sheets("Accueil").Select
Range("A3").Select
Unload Me
End Sub
Si celà peut aider quelqu'un à me dépanner, ou bien changer complétement le code. je cherche sur le forum des exemples mais pour le moment, je ne trouve pas grand chose, je trouve bien des combobox en série, mais pas d'affichage de données dans les textbox en fonction de la recherche des combobox.