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
| Private Sub UserForm_Initialize()
dim pc as string
ActiveWorkbook.Worksheets("liste").Activate
Dim DerLig As Integer, i As Integer, j As Integer
DerLig = Range("A1000").End(xlUp).Row
ComboBox1.Clear
i = 2
Do While i <= DerLig
ComboBox1.AddItem Range("A" & i)
i = i + 1
Loop
With ActiveWorkbook.Worksheets("onglet 2 ").Activate
For j = 2 To 50
'on va chercher dans l'onglet 2 , la colonne 4 correspondante à la valeur choisie dans la combobox et on l'affiche
If Cells(j, 2) = Variable Then Cells(j, 4).Value = pc
'on affiche ce qu'il y a de différent dans la collone B1
Next j
End With
End Sub |