- ©«¤l
- 44
- ¥DÃD
- 7
- ºëµØ
- 0
- ¿n¤À
- 51
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- XP
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2012-11-18
- ³Ì«áµn¿ý
- 2022-8-6
|
¦^´_ 20# gkld - Option Explicit
- Sub Ex()
- Dim Ex_Path As String, Ex_File As String, Ex_Date As String, Ex_Wb As Workbook
- Dim Rng As Range, Ex_Row As Integer, i As Integer
- Ex_Path = "C:\Documents and Settings\gkld\®à±\my kp\¸ê®Æ®w\old ¤W¥«\"
- Ex_File = Dir(Ex_Path & "A112*ALL_1.csv")
- If Ex_File = "" Then
- MsgBox "¨S¦³ A112*ALL_1.csv"
- Exit Sub
- End If
- Application.ScreenUpdating = False
-
- For i = 2 To 8
-
- With Sheets(i)
-
- .Range("a1") = "¤é´Á" '»s§@ªíÀY
- .Range("b1") = "¦¬½L"
- .Range("c1") = "º¦¶^"
- .Range("d1") = "º¦¶^²v"
- .Range("e1") = "¶}½L"
- .Range("f1") = "³Ì°ª"
- .Range("g1") = "³Ì§C"
- .Range("h1") = "¦¨¥æ¶q(³æ¦ì)"
- .Range("i1") = "¦¨¥æ¶q"
- Ex_File = Dir(Ex_Path & "A112*ALL_1.csv")
- Do While Ex_File <> ""
- Ex_Date = Replace(Ex_File, "A112", "") '®ø°£ÀɦW¤¤"A112"
- Ex_Date = Replace(Ex_Date, "ALL_1.csv", "") '®ø°£ÀɦW¤¤"ALL_1.csv"
- Ex_Date = DateSerial(Mid(Ex_Date, 1, 4), Mid(Ex_Date, 5, 2), Mid(Ex_Date, 7, 2)) '±a¤J¤é´Á
- If Not .Columns(1).Find(CDate(Ex_Date), LookIn:=xlFormulas) Is Nothing Then Exit For
- '*** ¤£¦A«½Æ¦³¸ê®Æ ****'CDate(Ex_Date)¤é´Á -> ¤u§@ªíAÄ椤 §ä¨ì¤é´Á(¦³):Â÷¶}¦^°é
- 'CDate¨ç¼Æ Date¥ô¦ó¥i¨Ï¥Îªº¤é´Á¹Bºâ¦¡¡C
- Set Ex_Wb = Workbooks.Open(Ex_Path & Ex_File) '¶}±Ò A11220070102ALL_1.csv.....
- '************************************************
- Ex_Row = .Cells(.Rows.Count, "A").End(xlUp).Offset(1).Row '¨ú±o¸ê®Æ¿é¤Jªº¦C¸¹
- Set Rng = Ex_Wb.Sheets(1).Range("a:a").Find(.Name, LookAt:=xlWhole)
-
- If Not Rng Is Nothing Then
- .Cells(Ex_Row, "A") = Ex_Date '¤é´Á¿é¤J ¦p²¾¨ì³o¸Ì '** ¥u°O¿ý¦³¸ê®Æªº¤é´Á
- .Cells(Ex_Row, "B") = Rng.Offset(, 8)
- .Cells(Ex_Row, "e") = Rng.Offset(, 5)
- .Cells(Ex_Row, "f") = Rng.Offset(, 6)
- .Cells(Ex_Row, "g") = Rng.Offset(, 7)
- .Cells(Ex_Row, "i") = Rng.Offset(, 2)
- End If
- '************************************************
- Ex_Wb.Close False 'Ãö³¬ A11220070102ALL_1.csv.....
- ' End If '*****¤@©P¤ºªº¤é´Á
- Ex_File = Dir '¤U¤@Ó"A112*ALL_1.csv"
- Loop
- End With
- Next
- Application.ScreenUpdating = True
- MsgBox "OK"
- End Sub
½Æ»s¥N½X ©ñªº¦ì¸m¦p¤W¡A§Ú°õ¦æªº®ÉÔ¡A´Nª½±µ¸õ¥X§Úªºi=2 to 8 ³oÓ¦^°é¤F
¸Ó¦p¦ó¸Ñ¨M¡H |
|