Option Compare Text
Sub Ventile(Wks As Worksheet) ' la variable wks est passée par la procédure appelante_
' dans le cas présent, "sheet activate" dans le module this workbook
Dim i%
Dim Cible As Range, RgSource As Range
If Wks.Name = "Base" Then Exit Sub
Set RgSource = Worksheets("Base").Range("A1").CurrentRegion
RgSource.Sort Key1:=Worksheets("Base").Range("A2"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Wks.Range("A1").CurrentRegion.Clear
For i = 1 To RgSource.Rows.Count
If Left(Wks.Name, 1) = Left(RgSource(i, 1), 1) Then
Set Cible = Wks.Cells(Wks.Range("A65536").End(xlUp).Row + 1, 1)
With Cible
.Value = RgSource(i, 1) & " " & RgSource(i, 2)
.Font.Bold = True
.Offset(1, 0).Value = RgSource(i, 7)
.Offset(2, 0).Value = Format(RgSource(i, 3), """Téléphone: ""00\.00\.00\.00\.00")
.Offset(1, 1).Value = RgSource(i, 5) & " " & RgSource(i, 6)
.Offset(2, 1).Value = Format(RgSource(i, 4), """Portable: ""00\.00\.00\.00\.00")
End With
End If
Next i
Wks.Columns.AutoFit
End Sub