Re,
Tout d'abord merci ma liste est parfaite, maintenant se pose le probleme de renvoyer les donnees dans un tableau excel.
Pour cela j' ai ajouter un bouton auquel g assigner ce code :
--------------------------------------------------------------------------------------------------------------------------------------------------------
Private Sub CommandButton1_Click()
Dim element_select As Boolean
Dim nb_elements, i As Integer
element_select = False
nb_elements = Userform1.ListBox1.ListCount
'Check the number of component selected
'The first one is assigned as 0, the counter start at 0
For i = 0 To nb_elements - 1
If Userform1.ListBox1.Selected(i) = True Then
element_select = True
Exit For
End If
Next
' If nothing has been selected it is unuseful to run the next steps !
If element_select = False Then
MsgBox "No component selected"
Exit Sub
End If
'Show the number of component selected
Label1.Caption = nb_elements & " have been selected"
'Select the cell which recieved the first value
Range("Inlet!B5").Select
'Writting of the values selected in the Excel sheet
For i = 0 To nb_elements - 1
'Give to the active cell the value selected in the first column of the ListBox
'Column's index starts at 0 then the value 0 is used
ActiveCell.Value = ListBox1.List(i, 0)
'Give to the cell at the right of the active cellthe value selected in the column 2
'Column's index starts at 0 then the value 1 is used
ActiveCell.Offset(0, 1).Value = ListBox1.List(i, 1)
'Moving down
ActiveCell.Offset(1, 0).Select
End If
Next i
End Sub
--------------------------------------------------------------------------------------------------------------------------------------------------------
Seulement il y a une erreur avec le dernier End If, je comprend bien qu il faut que je mette un if quelques part plus haut mais ou ??
Merci encore je sens que ca va marcher dans peu de tps (et grace a vous...)
See ya