Private Sub CommandButton1_Click()
Dim i As Long
Dim j As Long
Dim dl1 As Long
Dim dl2 As Long
Dim cellule As Range
Dim plage As Range
Dim nomfeuille1 As String
Dim col1 As String
Dim classeur1 As String
Dim lidep1 As Long
Dim lidep2 As Long
Dim nomfeuille2 As String
Dim col2 As String
Dim data1 As String
Dim chemin As String
Dim date1 As Date
Dim date2 As Date
Dim nb As Integer
Dim trouve As Boolean
Dim sh As Worksheet
'**********************************
classeur1 = ActiveWorkbook.Name
nomfeuille1 = "SAISIE"
col1 = "d"
lidep1 = 2
dl1 = Sheets(nomfeuille1).Range(col1 & "65536").End(xlUp).Row + 2
nomfeuille2 = "BD chauffeur" '"Feuil1"
col2 = "a"
lidep2 = 2
dl2 = Sheets(nomfeuille2).Range(col2 & "65536").End(xlUp).Row + 1
'************************************
With Sheets(nomfeuille1)
lig = recherchemot("A1:A" & dl2, Sheets(nomfeuille1).Range("b1"), nomfeuille2, 1)
Set plage = .Range(col1 & lidep1 & ":" & col1 & .Range(col1 & "65536").End(xlUp).Row)
For Each cellule In plage
' lecture nom du chauffeur
If cellule.Value <> "" Then
'recherche de son numéro retour colonne
i = recherchemot("A1:IV1", cellule.Value, nomfeuille2, 3)
' ecriture
Sheets(nomfeuille2).Cells(lig, i - 1).Value = cellule.Offset(0, 1).Value
Sheets(nomfeuille2).Cells(lig, i).Value = cellule.Offset(0, 2).Value
Sheets(nomfeuille2).Cells(lig, i + 1).Value = cellule.Offset(0, 3).Value
End If
Next cellule
End With
End Sub