Function PlageÀPartirDe(ByVal PlageDép As Range) As Range
Dim F As Worksheet, LDéb As Long, CDéb As Long, LMax As Long, CMax As Long, Plg As Range
Set F = PlageDép.Worksheet: LDéb = PlageDép.Row: CDéb = PlageDép.Column
With F.UsedRange: LMax = .Row + .Rows.Count - 1: CMax = .Column + .Columns.Count - 1: End With
Do:
' If IsEmpty(F.Cells(LMax, CMax).Value) Then
' If F.Cells(LMax, CMax).Value = "" Then
' Set Plg = F.Cells(LMax, CMax).End(xlToLeft)
' If Plg.Column >= CDéb And Not IsEmpty(Plg.Value) Then Exit Do
' Else: Exit Do
' End If
If WorksheetFunction.CountIf(F.Cells(LDéb, CDéb).Resize(LMax - LDéb + 1), "") < LMax - LDéb + 1 Then Exit Do
LMax = LMax - 1: Loop Until LMax < LDéb
Do:
' If IsEmpty(F.Cells(LMax, CMax).Value) Then
' Set Plg = F.Cells(LMax, CMax).End(xlUp)
' If Plg.Row >= LDéb And Not IsEmpty(Plg.Value) Then Exit Do
' Else: Exit Do
' End If
If WorksheetFunction.CountIf(F.Cells(LDéb, CDéb).Resize(, CMax - CDéb + 1), "") < CMax - CDéb + 1 Then Exit Do
CMax = CMax - 1: Loop Until CMax < CDéb
If LMax < LDéb Or CMax < CDéb Then Set PlageÀPartirDe = Nothing: Exit Function
Set PlageÀPartirDe = PlageDép.Resize(LMax - LDéb + 1, CMax - CDéb + 1)
End Function