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

[µo°Ý] ¨ÌÃöÁä¦r²¾°Ê¸ê®Æ

[µo°Ý] ¨ÌÃöÁä¦r²¾°Ê¸ê®Æ

¤j®a¦n¡G

1..        ²Ä2¦C²Î­ÜD:M¦WºÙ¨â¨â¬Û¦P,¦WºÙ¬Û¦Pªº²Ä¤@Ä榳¼Æ¦r,²Ä2Äæ´N·|ªÅ¥Õ
2..        A:Cªº¸ê®Æ,±Æ¦C·|ÅÜ°Ê,¸ê®Æ¤]·|¼W´î,
3..        macro_1.xls.²z³f³æ[AG5]ÃöÁä¦r,¥iÀH·NÅܤÆ,¥Ø«e³]©w¦r¬°"¦nªB¤Í"
4..        ½Ð°Ý¦p¦óÅýCÄ檺°Ó«~¦WºÙ,¥]§tÃöÁä¦r&Àx¦s®æ¤º¦³¼Æ¦rªÌ,¦V¦P¦WºÙªºÄæ¦ì¥k²¾,¦ý¤£¯à§ïÅܮ榡,µL¼Æ¦r,«h¤£°Ê§@
ÃöÁä¦r.rar (20.95 KB)

¦^´_ 1# PJChen

¸Õ¸Õ¬Ý
    Sub ex()
Dim Key$, C$, X%, S_NO
Dim A As Variant
Key = [AG5]
S_NO = [AG3]
C = Dir([AG1] & [AG2])
Do While C <> ""
   With Workbooks.Open([AG1] & C)
      With Workbooks(C).Worksheets(S_NO)
         For Each A In .Range(.[c5], .[c5].End(4))
            If A Like "*" & Key Then
               For X = 1 To 10 Step 2
                  If .Range(A.Address).Offset(, X) <> "" Then
                     .Range(A.Address).Offset(, X + 1) = .Range(A.Address).Offset(, X)
                     .Range(A.Address).Offset(, X) = ""
                  End If
               Next
            End If
         Next
      End With
      Application.DisplayAlerts = False
      Workbooks(C).Close True
      Application.DisplayAlerts = True
   End With
   C = Dir
Loop
End Sub

TOP

¦^´_ 2# jcchiang
·PÁ¤j¤j,
¥i¥H°õ¦æ¡I

TOP

¥»©«³Ì«á¥Ñ PJChen ©ó 2021-2-26 00:02 ½s¿è

¦^´_ 2# jcchiang

±z¦n,

µ{¦¡Àɤ¤¦]¬°¦³³\¦h¤u§@ªí,©Ò¥H§Úµy­×§ïµ{¦¡,³o­Óµ{¦¡´ú¸Õ®É¨S°ÝÃD,
¦ýµ{¦¡¤£ÅÜ©ñ¨ì¥t¤@macroµ{¦¡¤¤´NµL§@¥Î,§Ú¥t¤@µ{¦¡¤¤ªº[AG5]¬O¥Ñ¤½¦¡±a¥Xªº"¦nªB¤Í"
«á¨Ó§â³o¥y§ï¦¨«á­±¤]¦³"*" ,©~µM´N¨S°ÝÃD¤F,Why?
If A Like "*" & Key & "*" Then


²¾°ÊDC±Æ§Ç.rar (44.4 KB)

TOP

¦^´_ 4# PJChen

µLªk¤F¸Ñ"µL§@¥Î"¬O¤°»ò±¡§Î
«á­±¦h¥[­Ó"*"¥u¬OÅý±ø¥ó§ó¦h¿ï¾Ü

TOP

        ÀR«ä¦Û¦b : ­n¥Î¤ß¡A¤£­n¾Þ¤ß¡B·Ð¤ß¡C
ªð¦^¦Cªí ¤W¤@¥DÃD