- ©«¤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 ©ó 2014-12-1 10:51 ½s¿è
¦^´_ 1# jj369963 - Option Explicit
- Sub Ex_¦r¨åª«¥ó()
- Dim d As Object, i As Integer, k As Variant, Sh As Worksheet
- Set d = CreateObject("scripting.dictionary") '¦r¨åª«¥ó
- i = 2
- With Sheet1
- Do While .Cells(i, "c") <> ""
- d(.Cells(i, "c") & "") = "" '¦r¨åª«¥óªº key : classÄ檺È
- i = i + 1
- Loop
- For Each k In d '¦r¨åª«¥óªº key
- .Range("a1").AutoFilter 3, k '¦Û°Ê¿z¿ï ²Ä3Ä檺·Ç«h¬° k
- On Error Resume Next
- Set Sh = Sheets(k) 'k¤u§@ªí¤£¦s¦b·|¦³¿ù»~
- If Err <> 0 Then
- Set Sh = Sheets.Add(, Sheets(1))
- Sh.Name = k
- Err.Clear
- On Error GoTo 0
- End If
- Sh.UsedRange.Clear
- .UsedRange.Copy Sh.Range("A1")
- Next
- .Activate
- .Range("a1").AutoFilter
- End With
- End Sub
- Sub Ex_¶i¶¥¿z¿ï()
- Dim Rng As Range, Sh As Worksheet
- With Sheet1
- '¶i¶¥¿z¿ï¥XclassÄ椣«½ÆªºÈ
- .Range("C:C").AdvancedFilter xlFilterCopy, , Cells(1, .Columns.Count), True
-
- Set Rng = Cells(2, .Columns.Count)
- Do While Rng <> ""
- .Range("a1").AutoFilter 3, Rng '¦Û°Ê¿z¿ï ²Ä3Ä檺·Ç«h¬° Rng
- On Error Resume Next
- Set Sh = Sheets(Rng.Text) 'Rng.Text ¤u§@ªí¤£¦s¦b·|¦³¿ù»~
- If Err <> 0 Then
- Set Sh = Sheets.Add(, Sheets(1))
- Sh.Name = Rng.Text
- Err.Clear
- On Error GoTo 0
- End If
- Sh.UsedRange.Clear
- .UsedRange.Copy Sh.Range("A1")
- Set Rng = Rng.Offset(1)
- Loop
- .Activate
- .Range("a1").AutoFilter
- Rng.EntireColumn.Clear
- End With
- End Sub
½Æ»s¥N½X |
|