Sub SortByLists()
Dim avntList As Variant, lngNum As Long
avntList = Range("E2:E6")
Application.AddCustomList avntList
lngNum = Application.GetCustomListNum(avntList)
Range("A1").Sort Key1:=Range("A1"), _
Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=lngNum + 1
Application.DeleteCustomList lngNum
End Sub
根据自定义列表序号获取列表
Application.GetCustomListContents(i)返回一个数组