- ©«¤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
|
¦^´_ 11# donod - Option Explicit
- Sub Ex()
- Dim Rng(1 To 3) As Range, i As Integer, Ar(), S
- Set Rng(1) = Sheets("Sheet1").Range("b:b")
- Ar = Array(#9:14:00 AM#, #12:59:00 PM#, #4:59:00 PM#, #4:15:00 PM#, #12:00:00 PM#, #11:00:00 PM#)
- For i = 0 To UBound(Ar)
- Set Rng(2) = Rng(1).Find(Ar(i), LookIn:=xlFormulas)
- If Not Rng(2) Is Nothing Then
- S = Rng(2).Address
- Do
- If i <= Int(UBound(Ar) / 2) Then
- Rng(2).Offset(1, 1) = Rng(2).Offset(, 1)
- Else
- Rng(2).Offset(-1, 4) = Rng(2).Offset(, 4)
- End If
- If Not Rng(3) Is Nothing Then
- Set Rng(3) = Union(Rng(3), Rng(1).Parent.Range(Rng(1).Parent.Cells(Rng(2).Row, "a"), Rng(1).Parent.Cells(Rng(2).Row, "g")))
- Else
- Set Rng(3) = Rng(1).Parent.Range(Rng(1).Parent.Cells(Rng(2).Row, "a"), Rng(1).Parent.Cells(Rng(2).Row, "g"))
- End If
- Set Rng(2) = Rng(1).FindNext(Rng(2))
- Loop Until S = Rng(2).Address
- End If
- Next
- If Not Rng(3) Is Nothing Then Rng(3).Delete
- End Sub
½Æ»s¥N½X |
|