- ©«¤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
|
¶i¶¥¿z¿ï+¦Û°Ê¿z¿ï- Option Explicit
- Sub Ex()
- Dim Sh As Worksheet, Ar As Variant, i As Integer, M As Variant
- With ActiveWorkbook.Sheets("·JÁ`©ú²Ó")
- .Range("b:b").AdvancedFilter xlFilterCopy, , .Cells(1, .Columns.Count), True
- With .Cells(1, .Columns.Count).EntireColumn
- Ar = .SpecialCells(xlCellTypeConstants)
- Ar = Application.WorksheetFunction.Transpose(Ar)
- .Cells = ""
- End With
- On Error GoTo Sheet_Add '³B¸Ì¤u§@ªí¤£¦s¦bªº¿ù»~
- For i = 2 To UBound(Ar)
- .Range("A1").AutoFilter Field:=2, Criteria1:=Ar(i)
- .UsedRange.Columns("a:d").Copy ActiveWorkbook.Sheets(Ar(i)).[a1] '"·JÁ`©ú²Ó" ¦Û°Ê¿z¿ï«áªº¸ê®Æ, ½Æ»s
- Next
- .Range("A1").AutoFilter '¨ú®ø "·JÁ`©ú²Ó"¦Û°Ê¿z¿ï¼Ò¦¡
- .Activate
- On Error GoTo 0 'µ{¦¡¦³¿ù»~¤£³B¸Ì
- '§R°£¤u§@ªí¤£¦s"·JÁ`©ú²Ó"¿z¿ïÄ檺Ãþ§O
- Application.DisplayAlerts = False
- For Each Sh In ActiveWorkbook.Sheets
- If Sh.Name <> .Name Then If IsError(Application.Match(Sh.Name, Ar, 0)) Then Sh.Delete
- Next
- Application.DisplayAlerts = True
- End With
- Exit Sub
- '******************************
- Sheet_Add:
- ActiveWorkbook.Sheets.Add.Name = Ar(i)
- Resume
- End Sub
½Æ»s¥N½X |
|