- ©«¤l
- 976
- ¥DÃD
- 7
- ºëµØ
- 0
- ¿n¤À
- 1018
- ÂI¦W
- 0
- §@·~¨t²Î
- Win10
- ³nÅ骩¥»
- Office 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2013-4-19
- ³Ì«áµn¿ý
- 2024-12-18
|
¦^´_ 5# johnny1680
¤@¯ë¼Ò²Õ:
Sub §ó·s()
Dim Arr, xD, a, a2, n%
Arr = Range([b2], Cells(1, Columns.Count).End(1))
For j = 1 To UBound(Arr, 2)
If Arr(2, j) = "" Then Arr(2, j) = "¸ê®ÆµL"
Next
For j = 1 To UBound(Arr, 2)
For j2 = j + 1 To UBound(Arr, 2)
If Arr(2, j) > Arr(2, j2) Then
n = n + 1: a = Arr(1, j): a2 = Arr(2, j)
Arr(1, j) = Arr(1, j2): Arr(1, j2) = a
Arr(2, j) = Arr(2, j2): Arr(2, j2) = a2
End If
Next
Next
Range([b12], Cells(11, Columns.Count).End(1)).ClearContents
Range("b11").Resize(2, UBound(Arr, 2)) = Arr
End Sub
¤u§@ªí1
Private Sub Worksheet_Change(ByVal Target As Range)
With Target
If .Row = 1 Or .Row = 2 Then Call §ó·s
End With
End Sub |
-
-
1.PNG
(13.79 KB)
|