- ©«¤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
        
|
¦^´_ 6# cw3076
¨C¤@Óµ{§Ç³£¬O¨Ì¤£¦P»Ý¨D¦Ó¶q¨q§@¡@
- Sub Ex()
- Dim i As Integer, ii As Integer, Rng As Range, A%, x%
- ReDim Ar%(2, A)
- ReDim Xy%(1, x)
- With ActiveSheet.[C:C].SpecialCells(xlCellTypeConstants)
- .Cells(1).CurrentRegion.Sort Key1:=.Cells(1), Header:=xlYes, Order1:=xlAscending
- ' CÄ檺³sÄò½d³ò°µ±Æ§Ç
- If Not ActiveSheet.AutoFilter Is Nothing Then .AutoFilter 'ActiveSheet¦p¦³¦Û°Ê¿z¿ï «h¨ú®ø
- For i = Application.Min([C:C]) To Application.Max([C:C])
- .Cells(1).AutoFilter Field:=3, Criteria1:=i ' CÄ檺³sÄò½d³ò°µ¦Û°Ê¿z¿ï
- '''''''''קï Field:= 3 Y¬°¦Û°Ê¿z¿ïªº²Ä3ÓÄæ¦ì'''''''''
- Set Rng = .SpecialCells(xlCellTypeVisible)
- Set Rng = Rng.Areas(Rng.Areas.Count).Offset(, -1)
- Ar(0, A) = i
- Ar(1, A) = Application.Min(Rng)
- Ar(2, A) = Application.Max(Rng)
- For ii = Ar(1, A) To Ar(2, A)
- If IsError(Application.Match(ii, Rng, 0)) Then
- 'If Rng.Find(ii) Is Nothing Then §ï¥ÎMatch³t«× §Ö¤@¨Ç
- Xy(0, x) = ii
- Xy(1, x) = i
- x = x + 1
- ReDim Preserve Xy(1, x)
- End If
- Next
- A = A + 1: ReDim Preserve Ar(2, A)
- Next
- .Cells(1).AutoFilter
- End With
- ActiveSheet.[E2].Resize(A, 3) = Application.Transpose(Ar)
- ActiveSheet.[I2].Resize(x, 2) = Application.Transpose(Xy)
- End Sub
½Æ»s¥N½X |
|