- ©«¤l
- 31
- ¥DÃD
- 0
- ºëµØ
- 0
- ¿n¤À
- 31
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- office 2016
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2016-10-4
- ³Ì«áµn¿ý
- 2017-10-17
 
|
¦^´_ 9# RCRG
¬Ý¬Ý³o¼Ë¥i¥H¶Ü- Sub ex()
- Dim d, d1, rng() As Range, arr, i%, j%, rng1 As Range
- For i = 3 To Cells(Rows.Count, 3).End(xlUp).Row
- If Right(Cells(i, 3), 1) = ChrW(160) Then
- Cells(i, 3).Replace ChrW(160), ""
- End If
- Next i
- Set d = CreateObject("scripting.dictionary")
- Set d1 = CreateObject("scripting.dictionary")
- With Sheets("´ú¸Õ¶")
- Set rng1 = .Range("a2:a" & .Cells(Rows.Count, 1).End(xlUp).Row)
- arr = .Range("c3:f" & .Cells(Rows.Count, 3).End(xlUp).Row)
- .Range("c3:f" & .Cells(Rows.Count, 3).End(xlUp).Row).Interior.Color = xlNone
- For i = 1 To UBound(arr)
- d(arr(i, 1)) = d(arr(i, 1)) + 1
- Next i
- ReDim rng(1 To d.Count)
- t = d.items
- For i = 1 To d.Count
- k = k + t(i - 1)
- Set rng(i) = .Range(.Cells(2 + k - t(i - 1) + 1, 3), .Cells(2 + k, 6))
- If WorksheetFunction.CountIf(rng(i), ">" & .Range("c1")) = rng(i).Rows.Count And _
- WorksheetFunction.CountIf(rng1, rng(i).Cells(1, 1)) = 0 Then
- rng(i).Interior.Color = 255
- ElseIf WorksheetFunction.CountIf(rng(i), ">" & .Range("c1")) < rng(i).Rows.Count And _
- WorksheetFunction.CountIf(rng(i), ">" & .Range("c1")) <> 0 Then
- For j = 1 To rng(i).Rows.Count
- If rng(i).Cells(j, 4) < Range("c1") Then
- spr = Split(rng(i).Cells(j, 4), " ")(0)
- d1(spr) = d1(spr) + 1
- End If
- Next j
- k1 = d1.keys
- If d1.Count = 1 Then
- For j = 1 To rng(i).Rows.Count
- If rng(i).Cells(j, 4) < .Range("c1") And WorksheetFunction.CountIf(rng1, rng(i).Cells(1, 1)) = 0 Then
- rng(i).Rows(j).Interior.Color = 16711935
- End If
- Next j
- End If
- End If
- d1.RemoveAll
- Next i
- End With
- End Sub
½Æ»s¥N½X |
|