|
<p><br/>Sub fx2()<br/>Dim i As Long<br/>Dim j As Integer<br/>Dim ar<br/>Dim s As String<br/>Dim myi As Integer<br/>Dim CellRow<br/>Dim Cellid<br/>Dim ss As String<br/>Dim n As Integer<br/>Dim d As New Dictionary<br/>Dim ra As Range<br/>Dim bol As Boolean<br/>Dim boll As Boolean<br/>Dim t As Double</p><p>Application.ScreenUpdating = False<br/>t = Timer<br/>ar = Range("a1:a60000")<br/>For i = 1 To 60000 Step 200<br/> myi = myi + 1<br/> For j = 0 To 199<br/> s = myi & "-" & ar(i + j, 1)<br/> If Not d.Exists(s) Then<br/> d(s) = "a" & i + j<br/> Else<br/> d(s) = False<br/> End If<br/> Next<br/>Next</p><p>CellRow = d.items<br/>Cellid = Filter(CellRow, False, False)</p><p>n = UBound(Cellid)</p><p>For i = 0 To n<br/> ss = ss & Cellid(i) & ","<br/> If i Mod 35 = 0 Or i = n Then<br/> If bol Then<br/> Set ra = Union(ra, Range(Left(ss, Len(ss) - 1)))<br/> If boll Then<br/> With ra<br/> .Font.ColorIndex = 5<br/> .Interior.ColorIndex = 6<br/> End With<br/> bol = False<br/> boll = False<br/> Else<br/> boll = True<br/> End If<br/> Else<br/> Set ra = Range(Left(ss, Len(ss) - 1))<br/> bol = True<br/> End If<br/> ss = ""<br/> End If<br/>Next</p><p>Application.ScreenUpdating = True<br/>MsgBox Timer - t<br/>End Sub</p> |
|