Hi almugs,
I've been going nuts trying to find this post - I found it by searching "28 measures" (almugs didn't work) - well, anyway, try this:
Sub Almugs(): Dim wm As Worksheet, wl As Worksheet, Lineup As Range
Dim r As Long, c As Long, M, L, n As Integer, k As Long
Set wm = Sheets("Matrix"): Set wl = Sheets("Lineup")
M = wm.Cells(1).CurrentRegion: k = 1
L = wm.Range(wm.Cells(1, UBound(M, 2) + 1), wm.Cells(UBound(M), UBound(M, 2) + 2))
For r = 2 To UBound(M): n = 1
For c = 2 To UBound(M, 2)
L(n, 1) = M(1, c): L(n, 2) = (M(r, c)): n = n + 1
Next c
Set Lineup = wl.Range(wl.Cells(2, k), wl.Cells(UBound(M) + 1, k + 1)): Lineup = L
Lineup.Sort Key1:=wl.Cells(2, k + 1), Order1:=xlAscending, Header:=xlNo: k = k + 2
Next r
End Sub
Bookmarks