Sub test()
Dim Plage   As Range
Dim Nm      As Name
    ' On vérifie si la cellule fait partie d'un des noms de la feuille
    For Each Nm In Me.Names
        If Not Intersect(Range(Nm.RefersTo), ActiveCell) Is Nothing Then
            Set Plage = Range(Nm.RefersTo)
            Exit For
        End If
    Next
    
    ' Sinon On vérifie si la cellule fait partie d'un des noms du classeur
    If Plage Is Nothing Then
        For Each Nm In ThisWorkbook.Names
            If Not Intersect(Range(Nm.RefersTo), ActiveCell) Is Nothing Then
                Set Plage = Range(Nm.RefersTo)
                Exit For
            End If
        Next
    End If
    
    ' Si on a trouvé la plage, on la trie
    Select Case True
        Case Plage Is Nothing: ' Rien à faire
        Case Plage.Areas.Count > 1: MsgBox "les champs non contigus ne sont pas pris en charge", vbCritical
        Case Plage.Rows.Count > 1 And Plage.Columns.Count > 1:
            Dim T()
            ReDim T(Plage.Cells.Count - 1)
            For I = 0 To Plage.Cells.Count - 1 ' On charge les cellules dans un tableau simple
                T(I) = Plage.Cells(I + 1)
            Next
                For I = 0 To UBound(T) ' On trie ce tableau par ordre croissant
                    x = I
                    For k = x + 1 To UBound(T)
                        If T(k) <= T(x) Then x = k
                    Next k
                    If I <> x Then
                        ValTemp = T(x)
                        T(x) = T(I)
                        T(I) = ValTemp
                    End If
                Next I
            For I = 0 To Plage.Cells.Count - 1 ' On recharge le tableau dans la plage
                Plage.Cells(I + 1) = T(I)
            Next
        Case Else
            ' 1 colonne ou 1 ligne, on utilise les fonctions excel
            With Me.Sort
                .SortFields.Clear
                .SortFields.Add Key:=Plage, _
                    SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
                .SetRange Plage
                .Header = xlNo
                .MatchCase = False
                .Orientation = IIf(Plage.Rows.Count = 1, xlLeftToRight, xlTopToBottom)
                .SortMethod = xlPinYin
                .Apply
            End With
    End Select
    
End Sub