- ©«¤l
- 2035
- ¥DÃD
- 24
- ºëµØ
- 0
- ¿n¤À
- 2031
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-3-22
- ³Ì«áµn¿ý
- 2024-2-1
|
¦^´_ 8# Michelle-W - Sub ¦U¦Û¤ÀÃþ()
- Dim lg As Variant, ctn As Variant, xi As Boolean
- Dim dic As Object, sp As Variant
- Dim sh As Worksheet, wks As Worksheet
-
- Set sh = Worksheets("¿ï³æ")
- Set dic = CreateObject("scripting.dictionary")
-
- With sh
- For Each lg In .Range("C1", .Range("C1").End(xlToRight))
- .Select
-
- dic(lg.Value) = ""
- For Each ctn In .Range("A2", Range("A2").End(xlDown))
- If ctn.Offset(, lg.Column - 1) = "V" Then
- dic(lg.Value) = dic(lg.Value) + IIf(dic(lg.Value) = "", "", ",") + ctn.Value
- End If
- Next
- If dic(lg.Value) <> "" Then
- sp = Split(dic(lg.Value), ",")
- Cells(15, lg.Column).Resize(UBound(sp) + 1) = Application.Transpose(Array(sp)) ' ®i¥Ü¥Î
-
- xi = tblExist(lg.Value) ' §PÂ_ªí³æ¬O§_¦s¦b
- If xi = False Then
- Sheets.Add After:=Sheets(Worksheets.Count)
- ActiveSheet.Name = lg.Value
- End If
-
- With Worksheets(lg.Value)
- .Cells.Clear
- .[A1] = sh.[A1]
- .[B1] = lg.Value
- .[A2].Resize(UBound(sp) + 1) = Application.Transpose(Array(sp))
- .[B2].Resize(UBound(sp) + 1) = "V"
- End With
- End If
- Next
- End With
- End Sub
- Sub ·s¼W¿ï³æ()
- Dim rng As Range, rng2 As Range
-
- §R°£¤u§@ªí
- With Worksheets("¿ï³æ")
- .Cells.Clear
- Set rng = Sheets("Á`ªí").Range("A2", Sheets("Á`ªí").[A2].End(xlDown))
- .[C1].Resize(, rng.Count - 1) = Application.Transpose(rng)
- Set rng = Sheets("Á`ªí").Range("A16", Sheets("Á`ªí").[B16].End(xlDown))
- rng.Copy .[A1]
- End With
- End Sub
- Function tblExist(tblName As String) As Boolean
- Dim xi As Integer
-
- tblExist = False
- For xi = 1 To Worksheets.Count
- If Worksheets(xi).Name = tblName Then tblExist = True: Exit Function
- Next xi
- End Function
- Sub §R°£¤u§@ªí()
- Dim xi As Integer
-
- Application.DisplayAlerts = False
- For xi = Worksheets.Count To 2 Step -1
- If Worksheets(xi).Name <> "Á`ªí" And Worksheets(xi).Name <> "¿ï³æ" Then
- Worksheets(xi).Delete
- End If
- Next xi
- Application.DisplayAlerts = True
- End Sub
- Sub §R°£¦U¤À¶()
- §R°£¤u§@ªí
- With Worksheets("¿ï³æ")
- .Range("C2:" & Chr(64 + .[C1].End(xlToRight).Column) & 65535).Clear
- End With
- End Sub
½Æ»s¥N½X |
|