- ©«¤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
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2010-6-8 20:43 ½s¿è
¦^´_ 1# sujane0701
¸Õ¸Õ¬Ý ¥u¥i°Ï¤ÀÀx¦s®æ¦â±m ¦³©ÎµL- Sub Ex()
- Dim i%, Rng As Range, R, D(1 To 2) As Object, C%
- For i = 7 To 6 + (3 * 8) Step 3
- If Cells(Rows.Count, i).End(xlUp) <> Cells(1, i) Then
- Set D(1) = CreateObject("Scripting.Dictionary")
- Set D(2) = CreateObject("Scripting.Dictionary")
- Set Rng = Range(Cells(1, i), Cells(1, i).End(xlDown)).Resize(, 3)
- For Each R In Rng.Columns(1).Cells
- If R.Interior.ColorIndex <> xlNone Then ' <>xlNone-> ¤£µ¥©óµL¦â±m
- D(1)(R.Value) = R.Resize(, 3)
- C = R.Interior.ColorIndex '¨ú±o¦â±mªº No
- Else ' µL¦â±m
- D(2)(R.Value) = R.Resize(, 3)
- End If
- Next
- If D(1).Count > 0 Then
- With Rng(1).Resize(D(1).Count, 3)
- .Value = Application.Transpose(Application.Transpose(D(1).ITEMS))
- .Interior.ColorIndex = C
- .Sort Key1:=Rng(1), Header:=xlNo 'xlNoµL¼ÐÃD
- End With
- End If
- If D(2).Count > 0 Then
- With Rng(D(1).Count + 1, 1).Resize(D(2).Count, 3)
- .Value = Application.Transpose(Application.Transpose(D(2).ITEMS))
- .Interior.ColorIndex = xlNone
- .Sort Key1:=Rng(D(1).Count + 1, 1), Header:=xlNo
- End With
- End If
- End If
- Next
- End Sub
½Æ»s¥N½X |
|