Sub Nettoyage()
Dim Cmax%, Lmax%, L%, C%, DerCol%, DerLig%, F
' Zone à analysez, à modifier si necessaire
Cmax = 5000
Lmax = 5000
For Each F In Worksheets
With Sheets(F.Name)
DerCol = 0: DerLig = 0
Application.StatusBar = "Nettoyage de la feuille " & F.Name
' Trouver dernière colonne utilisée
For L = 1 To Lmax
If .Cells(L, Columns.Count).End(xlToLeft).Column > DerCol Then
DerCol = .Cells(L, Columns.Count).End(xlToLeft).Column
End If
Next L
' Trouver dernière ligne utilisée
For C = 1 To Cmax
If .Cells(Rows.Count, C).End(xlUp).Row > DerLig Then
DerLig = .Cells(Rows.Count, C).End(xlUp).Row
End If
Next C
' Suppression lignes et colonnes vides
.Range(.Cells(1, DerCol + 1), .Cells(1048576, 16384)).Delete Shift:=xlToLeft
.Rows(DerLig + 1 & ":" & Rows.Count).Delete Shift:=xlUp
End With
Next F
Application.StatusBar = ""
End Sub