Public MyParent As Worksheet
Property Set Parent(pParent)
Set MyParent = pParent
End Property
Private Sub UserForm_Initialize()
With Liste
.ColumnHeaders.Clear: .View = lvwReport: .FullRowSelect = True: .Gridlines = True
For Each x In Array("NOM", "TH", "G24", "G12", "NV"): .ColumnHeaders.Add , , x, 50: Next x
End With
'Format(CDate(M3.Value), "hh:nn:ss")
End Sub
Private Sub UserForm_Activate()
RemplirComboZone
End Sub
Function RemplirComboZone()
For Each cell In MyParent.Rows(8).SpecialCells(xlCellTypeConstants)
If cell <> "" Then ComboZone.AddItem cell
Next cell
End Function
Private Sub ComboZone_Change()
Liste.ListItems.Clear
For Each l In MyParent.Range("A10").Resize(MyParent.Range("A" & 2 ^ 16).End(xlUp).Row - 9, 1)
Set a = Liste.ListItems.Add(Text:=l)
For i = 2 To Liste.ColumnHeaders.Count: a.ListSubItems.Add Text:=l.Offset(, MyParent.Rows(8).Find(what:=ComboZone).Offset(1).Resize(1, Liste.ColumnHeaders.Count - 1).Find(what:=Liste.ColumnHeaders(i)).Column - 1): Next i
Next l
End Sub
Private Sub CommandButton2_Click()
Set f = New UserForm1: Set f.Parent = ActiveSheet
f.Show: Set f = Nothing
End Sub