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
| Dim ok As Boolean
Private Sub ComboBoxCodeGDO_Change()
Dim Ligne As Range
Dim derlign As Long
If ok = True Then Exit Sub
With Sheets("Registre départ PPI AFC")
derlign = .Range("F" & .Rows.Count).End(xlUp).Row
Set Ligne = .Range("A3:AN" & derlign).Find(ComboBoxCodeGDO.Value)
If Not Ligne Is Nothing Then
ok = True
ComboBoxCodeDépartHTA.Value = .Range("C" & Ligne.Row)
ComboBoxCentre.Value = .Range("A" & Ligne.Row)
ComboBoxNomPosteSource.Value = .Range("B" & Ligne.Row)
ComboBoxPoleExploit.Value = .Range("E" & Ligne.Row)
ComboBoxPPI.Value = .Range("G" & Ligne.Row)
ComboBoxAgenceExploit.Value = .Range("AL" & Ligne.Row)
ComboBoxNomDépartHTA.Value = .Range("D" & Ligne.Row)
ComboBoxCodeGDO.Value = .Range("F" & Ligne.Row)
ComboBoxNomPoste.Value = .Range("I" & Ligne.Row)
ComboBoxCommune.Value = .Range("J" & Ligne.Row)
ComboBoxSiteOperationnel.Value = .Range("AK" & Ligne.Row)
ComboBoxRéglagePréconisé.Value = .Range("R" & Ligne.Row)
Else
MsgBox "Le code GDO que vous cherchez n'existe pas, pensez à enlever le filtre excel"
End If
End With
ok = False
End Sub |
Partager