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