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

[µo°Ý] ¦p¦ó¤À¶}¤é´Á©M®É¶¡

¦^´_ 10# donod
³o¨â¥y¦³"D:"¬O¿ù»~
fs = ThisWorkbook.Path & "D:\test5.txt" 'TXTÀɦW¥Ø¿ý
fs = ThisWorkbook.Path & "D:\test5.xlsx" '¼g¤J¥Ø¼ÐÀɮץؿý

§ï¦¨
fs = ThisWorkbook.Path & "\test5.txt" 'TXTÀɦW¥Ø¿ý
fs = ThisWorkbook.Path & "\test5.xlsx" '¼g¤J¥Ø¼ÐÀɮץؿý

TOP

¦^´_ 10# donod

¿ù¦b­þ¸Ì?
1.§A³o­ÓÀɦpªG¬O¤w¸g¦sÀÉ
ThisWorkbook.Path¤w¸g·|¶Ç¦^§A³o­ÓÀɮתº¸ê®Æ§¨¦ì¸m
fs = ThisWorkbook.Path & "D:\test5.xlsx"
³o¼Ëfs´N¤w¸g¤£¬O"D:\test5.xlsx"¤F
Workbooks.Open´N·|²£¥Í§ä¤£¨ìÀɮתº¿ù»~
2.§A§âµ{¦¡½X¼g¦b¤u§@ªí¼Ò²Õ¤º¡A¦ÓWith Sheets(1)±Ô­z°Ï¬q¤º
¨S¦³¥[¤W.(¥y¸¹)´N·|«ü¦Vµ{¦¡©Ò¦b¤u§@ªí¤ºªºÀx¦s®æ
        .Columns("A:A").TextToColumns Destination:=.Range("A1"), DataType:=xlDelimited, _
        TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
        Semicolon:=True, Comma:=False, Space:=False, Other:=False, FieldInfo _
        :=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), _
        Array(7, 1)), TrailingMinusNumbers:=True
¥u®t¦b¬õ¦âªºÂIDestination:=.Range("A1")
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¥»©«³Ì«á¥Ñ donod ©ó 2013-4-8 22:32 ½s¿è

¦^´_ 11# luke
¦^´_ 12# Hsieh
¦pªG¨Ó·½ÀÉ®×test5.txt¬O¦bD:\
·Q¥Î¥t¥~¤@­ÓVBAÀÉ®×±Ntest5.txtÂà´«¦¨·Q­nªº®æ¦¡ÀÉtest5a.xlsx¡A¦p¦ó¼g?ÁÂÁÂ!

TOP

¦^´_  luke
¦^´_  Hsieh
¦pªG¨Ó·½ÀÉ®×test5.txt¬O¦bD:\
·Q¥Î¥t¥~¤@­ÓVBAÀÉ®×±Ntest5.txtÂà´«¦¨·Q­nªº®æ¦¡ÀÉtest5a.xlsx¡A¦p¦ó¼g?ÁÂÁÂ!
donod µoªí©ó 2013-4-8 22:29

¤j¤j¥i¦b2#¤¤§ä¨ì¬ÛÃöÀÉ®×

TOP

²{¦b¥u®tAÄ檺¤é´Á©M®É¶¡¥¼¯à¤À¶}¡A½Ð¤j¤j«ü±Ð¦p¦ó§ï¼g¡CÁÂÁÂ!
test5.rar (245 Bytes) ¨Ó·½ÀÉ
test A.rar (14.07 KB) VBAÀÉ
test5a.rar (7.14 KB) ·Q­nªºµ²ªG

TOP

¦^´_ 15# donod

Àɥؿý¥i¥h°£ThisWorkbook.Path ¦p¤U
fs = "D:\test5.txt" 'TXTÀɦW¥Ø¿ý
fs = "d:\test5.xlsx" '¼g¤J¥Ø¼ÐÀɮץؿý

¥t¤é´Á"m/d/yyy"®æ¦¡­n§ï¦¨ "yyyy/m/d" ¦p¤U

.[A:A].NumberFormatLocal = "yyyy/m/d" 'Åܧó¤é´Á®æ¦¡

TOP

¦^´_ 15# donod
  1. Sub Ex()
  2.     Dim E As Range, W As String
  3.     Workbooks.OpenText Filename:="D:\test5.txt"
  4.     With ActiveWorkbook.Sheets(1)
  5.         .Cells.Replace ";", " ", xlPart
  6.         .Columns(2).Insert
  7.         For Each E In .Range("A:A").SpecialCells(xlCellTypeConstants)
  8.             W = E
  9.             E = Mid(W, 1, 10)
  10.             E.NumberFormatLocal = "m/d/yyyy;@"
  11.             E.Offset(, 1) = Replace(Mid(W, 12), "/", ":")
  12.         Next
  13.     End With
  14. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 17# GBKEE


    ª©¤j¯uªºª¾¤p½ú¡A¥¿¬O³o­Ó!ÁÂÁÂGBKEEª©¤j!

TOP

¦^´_ 17# GBKEE


2013/04/02/09/21/00; 22159; 22159; 22131; 22131; 330
2013/04/02/09/22/00; 22133; 22140; 22130; 22140; 153
2013/04/02/09/23/01; 22140; 22148; 22134; 22139; 109
½Ð°Ý¦b¶×¤J·½Àɮ׮ɡA¤£¶×¤JÄÝ©ó®É¶¡¤¤ªº¬í­È(¬õ¦â¼Æ¦r)¡A¥i¥H«ç»ò¼g¡A¦A¦¸ÁÂÁª©¤j!

TOP

¦^´_ 19# donod

  1.            'E.Offset(, 1) = Replace(Mid(W, 12), "/", ":")
  2.             E.Offset(, 1) = Replace(Mid(W, 12, 5), "/", ":")
  3.            'W³o¦r¦ê±q²Ä12­Ó¦r¤¸°_¨ú5­Ó¦r¤¸
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ¦³®É·í«äµL®É­W¡A¦n¤Ñ­n¿n«B¨Ó³¡C
ªð¦^¦Cªí ¤W¤@¥DÃD