Thread: Dynamic sort
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
isabelle isabelle is offline
external usenet poster
 
Posts: 587
Default Dynamic sort

hi,

Sub ListDate()
Dim Dico As Object, c As Range
Set Dico = CreateObject("Scripting.Dictionary")
For Each nms In Names
Dico.Add Range(nms.Value), nms.Name
Next
With Sheets("Feuil2") '--- adapt the sheet name
..[A2].Resize(Dico.Count) = Application.Transpose(Dico.keys)
..[B2].Resize(Dico.Count) = Application.Transpose(Dico.Items)
..[A2].Sort Key1:=.[A2], Order1:=xlAscending, Header:=xlNo
End With
End Sub

isabelle