Sub AUTOAJUST2()
Dim wS As Worksheet
Dim dl As Integer, WSLR As Integer, WSLC As Integer
Dim PrintArea As Range
Dim i As Integer
' Pour boucler sur toutes les feuilles
For Each wS In Worksheets
WSLC = wS.Cells(1, Columns.Count).End(xlToLeft).Column
For i = 1 To WSLC
dl = wS.Cells(Rows.Count, i).End(xlUp).Row
If dl > WSLR Then WSLR = dl
Next i
Set PrintArea = wS.Range("A1:K" & WSLR)
wS.PageSetup.PrintArea = PrintArea.Address(0, 0)
Next wS
End Sub
Sub AUTOAJUST3()
Dim wS As Worksheet
Dim dl As Integer, WSLR As Integer, WSLC As Integer
Dim PrintArea As Range
Dim i As Integer
' Pour boucler sur toutes les feuilles sauf une
For Each wS In Worksheets
If wS.Name <> "Feuil2" Then ' Exclue la feuille : "Feuil2"
WSLC = wS.Cells(1, Columns.Count).End(xlToLeft).Column
For i = 1 To WSLC
dl = wS.Cells(Rows.Count, i).End(xlUp).Row
If dl > WSLR Then WSLR = dl
Next i
Set PrintArea = wS.Range("A1:K" & WSLR)
wS.PageSetup.PrintArea = PrintArea.Address(0, 0)
End If
Next wS
End Sub
Sub AUTOAJUST4()
Dim wS As Worksheet
Dim dl As Integer, WSLR As Integer, WSLC As Integer
Dim PrintArea As Range
Dim i As Integer, j As Integer
Dim arrayImpression()
' Pour boucler sur certaines feuilles
arrayImpression = Array("Glossaire", "Glossaire 2") ' Liste des feuilles à traiter
For j = 0 To UBound(arrayImpression)
Set wS = Sheets(arrayImpression(j))
WSLC = wS.Cells(1, Columns.Count).End(xlToLeft).Column
For i = 1 To WSLC
dl = wS.Cells(Rows.Count, i).End(xlUp).Row
If dl > WSLR Then WSLR = dl
Next i
Set PrintArea = wS.Range("A1:K" & WSLR)
wS.PageSetup.PrintArea = PrintArea.Address(0, 0)
Next j
End Sub