ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¥HCÄ欰¯Á¤Þ,§R°£¤£¥²­nªº¦C¼Æ,¦A¥t¦s·sÀÉ

¦^´_ 4# Andy2483

±z¦n,
1..µ{¦¡°õ¦æ¤£¤Óí©w,´ú¸Õ¦n¦h¦¸,¨C¦¸°õ¦æ³£¦³¤£¦Pªºµ²ªG,¦³®Éµ²ªG¬O¥¿±`ªº,¦ý¤j³¡¥÷¤£¥¿±`.
2..[G1]­ì¦³³]©w®æ¦¡,±N(¼Æ¦r)¥]¦b¸Ì­±,·í¥¦¬O¼Æ¦r®É,EX:56ªí­±¤W¬Ý°_¨Ó¬O(56),¹ê»Ú¬O¼Æ¦r56,
³o®É°õ¦æµ{¦¡·|¥X¿ù,¦h¤F¤@­ÓªÅÀÉ-(65)CPOMPA1148GP-SOY402,·í¼Æ¦r¥¼¥X²{®É,·|¥H(XXX)¼È¥N,³o®Éµ{¦¡¥t¦sªºÀɮ׼ƶq´N¥¿±`.

3..¸ê®Æ°Ï¤º,¦³³]©w¦Û°Ê´«¦æ,¦ý¥t¦s·sÀÉ«á,­ì¥»½Õ¾ã¦nªº¦C°ª,·|¦Û°ÊÁY´î
4..¥Î(XXX)´ú¸Õ,¤S¤£¥¿±`,¤@¼Ë·|¥X²{ªÅÀÉ,¦Ó¥B²Ä6¶µ,CÄ椤¨S¦³¥N¸¹,«o§â¥¦¦s¦bªÅÀɤ¤
5..Àɮ׸ê®Æ¤@ª½·|¦³ÅܤÆ,©Ò¥H»Ý­n´ú¸Õ«Ü¦hºØ¼Ò¦¡.
6..§Ú±N¨ä¤¤¤G¦¸µ²ªG,ÀɮפW¶Ç,½ÐÀ°¦£¬d¬Ýµ{¦¡

·PÁ¡I
65.rar (163.98 KB)
XXX.rar (164.35 KB)

TOP

¦^´_ 3# PJChen


    ÁÂÁ«e½ú¦^´_
«á¾Ç¥H#1¼Óªº½d¨Ò´Ó¤Jµ{¦¡½X°õ¦æ«á¤£·|²£¥Í#3¼ÓªºÀÉ®×,½Ð«e½ú¦A¸Õ¸Õ¬Ý©Î¤W¶Ç´Ó¤Jµ{¦¡ªº·s­ìÀÉ
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

¦^´_ 2# Andy2483
±z¦n,
´ú¸Õµ²ªG,°£¤F­ì¥ý¥t¦sªºÀÉ®×¥~,ÁÙ·|²£¥Í¤@­ÓµL¼t°ÓªºªÅÀÉ,¥i§_À°¦£¬Ý¬Ý~~·PÁÂ~~
-(XXX)CPOMPA1148GP-SOY402.rar (11.19 KB)

TOP

¦^´_ 1# PJChen


    ÁÂÁ«e½úµoªí¦¹¥DÃD»P½d¨Ò
«á¾Ç¾Ç²ß¤è®×¦p¤U,½Ð«e½ú°Ñ¦Ò

Option Explicit
Sub TEST()
Dim Brr, Crr, V, Y, i&, j&, R, T, Td$, Tn$, G1$
Dim xR As Range, xU As Range, Sh As Worksheet, MyBook, MyPath
Set Y = CreateObject("Scripting.Dictionary")
Set Sh = Sheets("¸ËÂd³qª¾")
Set R = Sh.[D:D].Find("TOTAL", Lookat:=xlWhole)
If Not R Is Nothing Then R = R.Row
Brr = Range(Sh.[A7], Sh.Cells(R - 1, "H"))
For i = 1 To UBound(Brr)
   If Brr(i, 1) = "" Then
      For j = 1 To 8: T = T & Trim(Brr(i, j)): Next
      If T <> "" Then Brr(i, 1) = Brr(i - 1, 1) Else: GoTo i01
   End If
   Y(Brr(i, 1)) = Y(Brr(i, 1)) + 1
   If Y(Brr(i, 1) & "|c") = "" Then Y(Brr(i, 1) & "|c") = Brr(i, 3)
i01: T = "": Next
If Y.Count = 0 Then Exit Sub
G1 = Sh.[G1].Text & Sh.[E1] & "-" & Replace(Replace(Sh.[G2], "/", ""), "#", "") & Sh.[H2]
Td = Format(Now, "YYYY_MM_DD_HH_MM_SS")
Set MyBook = ThisWorkbook
MyPath = MyBook.Path & "\"
If Dir(MyPath & Td, vbDirectory) = "" Then MkDir MyPath & Td
For Each T In Y.KEYS
   If InStr(T, "|") Then GoTo i02
   Sheets("¸ËÂd³qª¾").Copy
   Set xU = Cells(Rows.Count, 1).Resize(1, 8)
   For i = 1 To UBound(Brr)
      If Brr(i, 1) <> T Then
         Set xU = Union(Cells(i + 6, 1).Resize(1, 8), xU)
      End If
   Next
   xU.Delete: [A7] = 1
   Tn = Y(T & "|c") & "-" & G1 & ".xlsx"
   ActiveWorkbook.SaveAs Filename:=MyPath & Td & "\" & Tn, _
        FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
   ActiveWindow.Close
i02: Next
[A7].Resize(UBound(Brr), 8) = Brr
Set Y = Nothing: Set Sh = Nothing: Erase Brr
End Sub
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

        ÀR«ä¦Û¦b : ¨C¤ÑµL©Ò¨Æ¨Æ¡A¬O¤H¥Íªº®ø¶OªÌ¡A¿n·¥¡B¦³¥Î¤~¬O¤H¥Íªº³Ð³yªÌ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD