Excel VBA: Sorting a range using a permutation array as the key
I'd like to sort a range using a permutation stored in an array. I tried something like this:

    Sub PermSort()
      Dim Perm() As Variant
      Perm = Array(1, 6, 7, 8, 5, 2, 4, 3)
      Range("A1:A8").Sort Key1:=Perm, order1:=xlAscending
    End Sub

but it doesn't work, since Key1 is expected to be a Range.  
Is it possible to somehow use the build in <code>.Sort</code> method?

Excel VBA: Sorting a range using a permutation array as the key
===

I'd like to sort a range using a permutation stored in an array. I tried something like this:

    Sub PermSort()
      Dim Perm() As Variant
      Perm = Array(1, 6, 7, 8, 5, 2, 4, 3)
      Range("A1:A8").Sort Key1:=Perm, order1:=xlAscending
    End Sub

but it doesn't work, since Key1 is expected to be a Range.  
Is it possible to somehow use the build in <code>.Sort</code> method?
