try
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim lc As Integer
lc = Cells(4, Columns.Count).End(xlToLeft).Column
If Target.Row = 4 And Target.Column <= lc Then
sortdescent Target.Column - 1, lc
End If
End Sub
код модуля
Sub sortdescent(x As Integer, col As Integer)
Dim vDB
Dim strTemp()
Dim r As Integer, c As Integer, i As Integer, j As Integer
Dim m As Integer
ReDim strTemp(1 To 2, 1 To col)
vDB = Range("b5", Cells(Range("c" & Rows.Count).End(xlUp).Row, col))
r = UBound(vDB, 1)
c = UBound(vDB, 2)
For i = 1 To r Step 2
For j = 1 To r Step 2
'If vDB(j, x) > vDB(i, x) Then 'Ascent
If vDB(j, x) < vDB(i, x) Then 'Descent
For m = 1 To c
strTemp(1, m) = vDB(i, m)
strTemp(2, m) = vDB(i + 1, m)
vDB(i, m) = vDB(j, m)
vDB(i + 1, m) = vDB(j + 1, m)
vDB(j, m) = strTemp(1, m)
vDB(j + 1, m) = strTemp(2, m)
Next
End If
Next j
Next i
Range("b5").Resize(r, c) = vDB
End Sub