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

[µo°Ý] ½Ð°Ý¦p¦ó¦Û°Ê¶×¤J¥~³¡¸ê®Æ

[µo°Ý] ½Ð°Ý¦p¦ó¦Û°Ê¶×¤J¥~³¡¸ê®Æ

·Q½Ð±Ð¤j®aExcel¦p¦ó¦Û°Ê¶×¤J¥~³¡¸ê®Æªº¬ÛÃö°ÝÃD...
¥Ø«e¨C¤Ñ³£·|¦³©T©wªºÀɮ׻ݭn¶×¤J¨ìExcel¤£¦PªºSheet
¦ý¬O¨C¤ÑªºÀɦW³£¦³¥[¤W¤é´Á¡A©Ò¥HÀɦW·|ÀHµÛ¤é´Á§ïÅÜ¡A
·Q½Ð°Ý¤j®a¦p¦óÅýExcel¦Û°Ê¶×¤J³o¨ÇÀɮרì«ü©wªºSheet?
¨Ò¦p:
9¤ë17¤é¡A§Ú¥²¶·±NÀɦW
"F03-MB-1_0916_103051.log"ªºÀɮפº®e¶×¤J¨ìExcelªº"MB-1" sheet
"F03-MB-2_0916_103051.log"ªºÀɮפº®e¶×¤J¨ìExcelªº"MB-2" sheet
"F03-MB-3_0916_103051.log"ªºÀɮפº®e¶×¤J¨ìExcelªº"MB-3" sheet
"F03-MB-4_0916_103051.log"ªºÀɮפº®e¶×¤J¨ìExcelªº"MB-4" sheet
"F03-MB-5_0916_103051.log"ªºÀɮפº®e¶×¤J¨ìExcelªº"MB-5" sheet
"F03-MB-6_0916_103051.log"ªºÀɮפº®e¶×¤J¨ìExcelªº"MB-6" sheet
....Á`¦@¦³50­ÓÀÉ®×­n¶×¤J¨ì50­Ósheet (­Y·í¤Ñ¯Ê¤ÖÀɮסA«h¸Ósheet¤º®e¬°ªÅ¥Õ)

9¤ë18¤é¡A§Ú¥²¶·±NÀɦW
"F03-MB-1_0917_103051.log"ªºÀɮפº®e¶×¤J¨ìExcelªº"MB-1" sheet
"F03-MB-2_0917_103051.log"ªºÀɮפº®e¶×¤J¨ìExcelªº"MB-2" sheet
"F03-MB-3_0917_103051.log"ªºÀɮפº®e¶×¤J¨ìExcelªº"MB-3" sheet
"F03-MB-4_0917_103051.log"ªºÀɮפº®e¶×¤J¨ìExcelªº"MB-4" sheet
"F03-MB-5_0917_103051.log"ªºÀɮפº®e¶×¤J¨ìExcelªº"MB-5" sheet
"F03-MB-6_0917_103051.log"ªºÀɮפº®e¶×¤J¨ìExcelªº"MB-6" sheet
....Á`¦@¦³50­ÓÀÉ®×­n¶×¤J¨ì50­Ósheet  (­Y·í¤Ñ¯Ê¤ÖÀɮסA«h¸Ósheet¤º®e¬°ªÅ¥Õ)

0916 SEL.zip (21.95 KB)

¦^´_ 1# sandra_wang
¸Õ¸Õ¬Ý
  1. Sub ¶×¤J¤å¦rÀÉ_Ex()
  2.     Dim MyPath As String, TheDate As String, TheFile As String, ShName As String, Mystr As String, Rng As Range, E As Variant
  3.     MyPath = ThisWorkbook.Path & "\"                    '¤å¦rÀÉ©Ò¦bªº¥Ø¿ý
  4.     TheDate = Format(Date - 1, "mm/dd")                 '¨úªº¤é´Á
  5.     On Error Resume Next                                'DIR §ä¤£¨ìÀÉ®×·|²£¥Í¿ù»~
  6.     TheFile = Dir(MyPath & "*MB-*" & TheDate & "*.log") '´M§äÀÉ®×
  7.     If Err.Number > 0 Then MsgBox "§ä¤£¨ì  " & TheDate & "  ÀÉ®×": Exit Sub
  8.     Do While TheFile <> ""
  9.         On Error GoTo ShAdd                             '¤u§@ªí¤¤¨S¦³ ShName·|²£¥Í¿ù»~
  10.         ShName = Mid(TheFile, InStr(TheFile, "MB-"), InStr(TheFile, "_") - InStr(TheFile, "MB-"))
  11.         Set Rng = Sheets(ShName).Cells(Rows.Count, "A").End(xlUp)
  12.         If Rng <> "" Then Set Rng = Rng.Offset(1)
  13.         Open MyPath & TheFile For Input As #1        '¶}±Ò¤å¦rÀÉ
  14.             Do While Not EOF(1)                      '¤£¬OÀɮש³³¡®É °õ¦æ°j°é
  15.                 Input #1, Mystr                      '±q¤w¶}±Òªº´`§ÇŪ¨ú¸ê®Æ¡A¨Ã±N¸ê®Æ«ü©wµ¹ÅܼơC->mystr
  16.                 For Each E In Split(Mystr, Chr(10))
  17.                     Rng = E
  18.                     Set Rng = Rng.Offset(1)
  19.                 Next
  20.             Loop
  21.         Close #1                                 'Ãö³¬¤å¦rÀÉ
  22.         TheFile = Dir
  23.     Loop
  24.     Exit Sub
  25. ShAdd:
  26.     ThisWorkbook.Sheets.Add.Name = ShName
  27.     Err.Clear
  28.     Resume
  29. End Sub
½Æ»s¥N½X

TOP

²Ä4¦æ¿ù»~ TheDate = Format(Date - 1, "mm/dd")
À³¸Ó¬OTheDate = Format(Date - 1, "mmdd")

TOP

¦^´_ 3# jackie-ap
ÁÂÁ«ü¥¿

TOP

¥»©«³Ì«á¥Ñ sandra_wang ©ó 2011-10-11 14:14 ½s¿è


§Ú§â¸ê®Æ©ñ¦b®à­±ªºSEL¸ê®Æ¸Ì­±¤W¡A

²Ä¤T¦æªº¸ô®|¬O¶ñ¤J C:\Documents and Settings\97051909\®à­±\SEL

­è­è¸Õ¹L¤F¡A¦ý¬O·|¥X²{"§ä¤£¨ì1010ÀÉ®×"
¥i¥H½Ð¤j®aÀ°§Ú¬Ý¬Ý­þ¸Ì§Ë¿ù¶Ü?

TOP

¦^´_ 5# sandra_wang
   C:\Documents and Settings\97051909\®à­±\SEL\
§A¦³¥[¤W¶Ü?

TOP

¥»©«³Ì«á¥Ñ sandra_wang ©ó 2011-10-12 13:43 ½s¿è

¥i¥H¤F~~·PÁª©¥D!!

2011-10-12 ¤U¤È 01-07-07.jpg (58.04 KB)

2011-10-12 ¤U¤È 01-07-07.jpg

TOP

        ÀR«ä¦Û¦b : ¹D¼w¬O´£ª@¦Û§Úªº©ú¿O¡A¤£¸Ó¬O¨þ¥¸§O¤HªºÃ@¤l¡C
ªð¦^¦Cªí ¤W¤@¥DÃD