一連のリストを「名前」という列のアルファベット順に並べ替えようとしています。以下のコードはエラーなしでコンパイルし、エラーなしで実行していますが、リストを並べ替えていません。
誰か助けてもらえますか?
'**
' Sorts the defined list using the definded parameters
''
Function sort_list(list_name As String, column_name As String, Optional sort_order As String = xlAscending)
Dim list As ListObject ' The list that is to be sorted
Dim sort_column As Range ' The column in the list that is to be used as the sort key
' Set the list and the sort column
Set list = WS_ext.ListObjects(list_name)
Set sort_column = list.ListColumns(column_name).Range
' Sort the list
With list.Sort
.SortFields.Clear
.SortFields.Add sort_column, sort_order
.Header = xlYes
.MatchCase = False
.Apply
End With
End Function