Dim c As Range
[COLOR=Green][B]Dim fichier As Workbook
Set fichier = Workbooks("A.xls")
fichier.Sheets("???").Activate[/B][/COLOR]
Application.ScreenUpdating = False
ActiveWindow.View = xlPageBreakPreview
ActiveSheet.ResetAllPageBreaks
cpte = 0
With Sheets("[B][COLOR=Red]???[/COLOR][/B]").Range("A2:G65000")
Set c = .Find("FEUILLE DE RAMASSAGE", LookIn:=xlValues, lookat:=xlPart, SearchDirection:=xlPrevious)
If Not c Is Nothing Then
firstAddress = c.Address
Do
cpte = cpte + 1
On Error Resume Next
Set Sheets("[B][COLOR=Red]???[/COLOR][/B]").HPageBreaks(cpte).Location = c
If Err.Number <> 0 Then ActiveSheet.HPageBreaks.Add Before:=c
On Error GoTo 0
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
With Sheets("[B][COLOR=Red]???[/COLOR][/B]").Columns("F:G")
Set c = .Find("FACTURE", LookIn:=xlValues, lookat:=xlPart)
If Not c Is Nothing Then
firstAddress = c.Address
Do
ActiveSheet.HPageBreaks.Add Before:=c.Offset(-1)
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
Application.ScreenUpdating = True