- ©«¤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
|
¦^´_ 13# emma
Àx¦s®æ®Ç¥X²{¡u!¡v ¨º¬O¿ù»~Àˬdªº´£¥Ü¥\¯àªí,¥i¹î¬Ý¤u¨ã->¿ï¶µ ->¿ù»~Àˬd
Sub Ex() '¦pªG¨Ï¥ÎªÌ¤£¤p¤ßÂI¿ù:èèÂI¿ù ©Î §R¥þ³¡¡A³o¬q´N§¹¥þ¨S¦³¤ÏÀ³¡A Ex() ³oµ{¦¡ ¤£·| ¦Û°Ê°õ¦æªº.¥¦¤£¬O¤u§@ªíªºÄ²°Ê¨Æ¥ó
- Option Explicit
- Private Sub Worksheet_Change(ByVal Target As Range) '***¥¦¬O¤u§@ªíªºÄ²°Ê¨Æ¥ó ***
- Dim Target_Row As String
- If Target.Address(0, 0) = "D1" Then
- Range("F3").AutoFilter Field:=6, Criteria1:="*" & Target & "*"
- ElseIf Target.Address(0, 0) = "B1" Then
- Range("B3").AutoFilter Field:=2, Criteria1:="*" & Target & "*"
- ElseIf Not Application.Intersect(Range("b4", Range("b4").End(xlDown)).Offset(, -1), Target) Is Nothing Then
- Target_Row = Target(, 2) & "," & Target(, 3) & "," & Target(, 4) & "," & Target(, 5) & "," & Target(, 6)
- §ïÅܨϥΪº¤è¦¡ Target.Value, Target_Row
- End If
- End Sub
- Private Sub §ïÅܨϥΪº¤è¦¡(¶Ç°e¦¸¼Æ As Integer, ±µ¦¬¦r¦ê As String)
- Dim xi As Integer, xi_¦¸¼Æ As Integer, xi_¦r¦ê, Rng As Range
- With Sheet2
- xi = 7
- Do While .Cells(xi, 1) <> ""
- xi_¦r¦ê = Join(Application.Transpose(Application.Transpose(.Cells(xi, 1).Resize(, 5))), ",")
- If xi_¦r¦ê = ±µ¦¬¦r¦ê Then
- If xi_¦¸¼Æ < ¶Ç°e¦¸¼Æ Then
- xi_¦¸¼Æ = xi_¦¸¼Æ + 1
- ElseIf xi_¦¸¼Æ = ¶Ç°e¦¸¼Æ Then
- If Rng Is Nothing Then Set Rng = .Cells(xi, 1) Else Set Rng = Union(Rng, .Cells(xi, 1))
- End If
- End If
- xi = xi + 1
- Loop
- If xi_¦¸¼Æ < ¶Ç°e¦¸¼Æ Then
- For xi = xi To xi + ¶Ç°e¦¸¼Æ - xi_¦¸¼Æ - 1
- .Cells(xi, 1).Resize(, 5) = Split(±µ¦¬¦r¦ê, ",")
- Next
- .Range("A6").CurrentRegion.Sort Key1:=.Range("A7"), Order1:=xlAscending, Key2:=.Range( _
- "B7"), Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase _
- :=False, Orientation:=xlTopToBottom, SortMethod:=xlStroke, DataOption1:= _
- xlSortNormal, DataOption2:=xlSortNormal
- ElseIf Not Rng Is Nothing Then
- Rng.EntireRow.Delete
- End If
- End With
- End Sub
½Æ»s¥N½X |
|