- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 3# kasl - Option Explicit
- Sub Ex()
- Dim i As Integer, Rng As Range
- With ActiveSheet 'Sheets("sheet1")
- .UsedRange.Sort Key1:=.Range("A2"), Order1:=xlAscending, Key2:=.Range( _
- "E2"), Order2:=xlAscending, Header:=xlYes
- i = 2
- Do While .Cells(i, "E") <> ""
- If .Cells(i, "b") = .Cells(i + 1, "b") Then '·í¤é»P¤U¤@¤é ӪѦWºÙ¤@¼Ë
- If .Cells(i, "E") = .Cells(i + 1, "E") Or .Cells(i, "E") > .Cells(i + 1, "C") Then
- '.Cells(i, "E") = .Cells(i + 1, "E")-> ¥X³õ¤é¤@¼Ë
- '.Cells(i, "E") > .Cells(i + 1, "C")-> ·í¤é¶i³õÁÙ¨S¥X³õ ¤U¤@µ§´N¶i³õ
- If Rng Is Nothing Then
- Set Rng = .Cells(i, "E").Offset(1)
- Else
- Set Rng = Union(Rng, .Cells(i, "E").Offset(1))
- End If
- End If
- End If
- i = i + 1
- Loop
- If Not Rng Is Nothing Then
- Rng.EntireRow.Delete
- .UsedRange.Sort Key1:=.Range("C2"), Order1:=xlAscending, Key2:=.Range( _
- "A2"), Order2:=xlAscending, Header:=xlYes
- End If
- End With
- End Sub
½Æ»s¥N½X |
|