kunguito
06-27-2008, 07:08 AM
I create via code a CustomList. Alternatively in Excel, Tools/options->Custom List
Dim ex As Excel.Application
Dim List() As String
List=Array("...","...","...")
ex.AddCustomList List
I use it as an OrderCustom parameter to sort a Range as follows:
Index.CustomList=ex.CustomListCount + 1
Rg.Sort key1:=ws.Columns("C"), Order1:=xlAscending, OrderCustom:=IndexCustomList, MatchCase:=False, Orientation:=xlTopToBottom
And then I delete the Custom List.
Now the tricky part: If the CustomList already exists how could I know its index (IndexCustomList)?
Thanks!
Dim ex As Excel.Application
Dim List() As String
List=Array("...","...","...")
ex.AddCustomList List
I use it as an OrderCustom parameter to sort a Range as follows:
Index.CustomList=ex.CustomListCount + 1
Rg.Sort key1:=ws.Columns("C"), Order1:=xlAscending, OrderCustom:=IndexCustomList, MatchCase:=False, Orientation:=xlTopToBottom
And then I delete the Custom List.
Now the tricky part: If the CustomList already exists how could I know its index (IndexCustomList)?
Thanks!