J'ai modifier le code comme ci, est-ce bon ? cela fonctionne mais comme j'apprend ;-)
Dim Rng, TblBD(), NbCol
Option Compare Text
Private Sub ListBox1_Click()
Dim fin&, ref
If ActiveSheet.Name = "BDD" Then
If ListBox1.ListIndex = -1 Then Exit Sub
fin = Feuil1.Range("D" & Rows.Count).End(3).Row + 1
'Feuil1.Cells(fin, 4) = ListBox1.List(ListBox1.ListIndex, 1)
ref = MsgBox("Quelle cellule Remplir Expéditeur?", vbYesNo, "Choisir Expéditeur")
If ref = vbYes Then
Feuil1.Cells(fin, 4) = ListBox1.List(ListBox1.ListIndex, 1)
Else
Feuil1.Cells(fin, 5) = ListBox1.List(ListBox1.ListIndex, 1)
End If
Else
If ListBox1.ListIndex = -1 Then Exit Sub
If ActiveSheet.Name = "DdeTrsp" Then
ref = MsgBox("Quelle cellule Remplir Expéditeur?", vbYesNo, "Choisir Expéditeur")
If ref = vbYes Then
Feuil2.Cells(9, 2) = ListBox1.List(ListBox1.ListIndex, 1)
Else
Feuil2.Cells(16, 2) = ListBox1.List(ListBox1.ListIndex, 1)
End If
Else
Exit Sub
End If
End If
Unload Me
End Sub
Les chiffres entre () c'est quoi ? le end(3) et +1
fin = Feuil1.Range("D" & Rows.Count).End(3).Row + 1