Sub transfert()
client = Split(ActiveSheet.Shapes(Application.Caller).TextFrame.Characters.Text, "_")(1)
tableau = "Commandes_" & client
Set donnees = ActiveSheet.ListObjects(tableau).DataBodyRange
If donnees Is Nothing Then Exit Sub
With Sheets("Registre_Commandes_Validées")
With .ListObjects(1)
.ListRows.Add
ligne = .ListRows.Count
donnees.Copy Destination:=.DataBodyRange.Cells(.ListRows.Count, 1)
donnees.Delete
.DataBodyRange.Replace What:=tableau, Replacement:="", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
For i = ligne To .ListRows.Count
.DataBodyRange.Cells(i, 5).Replace What:="$B$", Replacement:="Commandes!$B$", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
Next
End With
End With
End Sub