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

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

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

test A.rar (14.51 KB)
½Ð°Ý¦p¦ó§ï¼g¡A¤~¥i±o¨ì¥H¤Uµ²ªG:
test5.rar (7.14 KB)   
ÁÂÁÂ!

º|¤F¨Ó·½.TXTÀɮסA²{¸É¤W¨Ó·½.TXTÀÉ®×
test5.rar (245 Bytes) ¨Ó·½.TXTÀÉ®×
test A.rar (14.51 KB) VBAÀÉ®×
½Ð°Ý¦p¦ó§ï¼g¡A¤~¥i±o¨ì¥H¤Uµ²ªG:

test5a.rar (7.14 KB) ·Q­nªºÀÉ®×

TOP

¦^´_ 2# donod
  1. Sub input_txt()
  2. Dim Ay()
  3. fs = ThisWorkbook.Path & "\test5.txt" 'TXTÀɦW¥Ø¿ý
  4. ar = Array(";", ":", ":")
  5. Open fs For Input As #1
  6. Do While Not EOF(1)
  7.    Line Input #1, mystr
  8.    For i = 0 To 2
  9.    Replace
  10.       mystr = Application.Substitute(mystr, "/", ar(i), 3) '¨ú¥N¤À¹j²Å¸¹
  11.    Next
  12.    ReDim Preserve Ay(s)
  13.    Ay(s) = mystr
  14.    s = s + 1
  15. Loop
  16. Close #1
  17. fs = ThisWorkbook.Path & "\test5.xlsx" '¼g¤J¥Ø¼ÐÀɮץؿý
  18. With Workbooks.Open(fs)
  19. .Sheets(1).[A1].CurrentRegion.Clear '²M°£­ì¸ê®Æ
  20. .Sheets(1).[A1].Resize(s, 1) = Application.Transpose(Ay) '¼g¤J¸ê®Æ
  21. With .Sheets(1).Columns("A:A") '¸ê®Æ­åªR
  22.    .TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
  23.    TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
  24.    Semicolon:=True
  25.    .NumberFormatLocal = "m/d/yyyy" 'Åܧó¤é´Á®æ¦¡
  26. End With
  27. End With
  28. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 3# Hsieh
¤´µM¤£¦¨¥\
test A1.rar (13.22 KB)

TOP

¦^´_ 4# donod
¸ê®Æ­åªR«ü¦W¤Þ¼Æ¤£¯à©¿²¤
  1. Sub input_txt()
  2. Dim Ay()
  3. fs = ThisWorkbook.Path & "\test5.txt" 'TXTÀɦW¥Ø¿ý
  4. ar = Array(";", ":", ":")
  5. Open fs For Input As #1
  6. Do While Not EOF(1)
  7.    Line Input #1, mystr
  8.    For i = 0 To 2
  9.       mystr = Application.Substitute(mystr, "/", ar(i), 3) '¨ú¥N¤À¹j²Å¸¹
  10.    Next
  11.    ReDim Preserve Ay(s)
  12.    Ay(s) = mystr
  13.    s = s + 1
  14. Loop
  15. Close #1
  16. fs = ThisWorkbook.Path & "\test5.xlsx" '¼g¤J¥Ø¼ÐÀɮץؿý
  17. With Workbooks.Open(fs)
  18. With .Sheets(1)
  19. .[A1].CurrentRegion.Clear '²M°£­ì¸ê®Æ
  20. .[A1].Resize(s, 1) = Application.Transpose(Ay) '¼g¤J¸ê®Æ
  21. '¸ê®Æ­åªR
  22.     .Columns("A:A").TextToColumns Destination:=.Range("A1"), DataType:=xlDelimited, _
  23.         TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
  24.         Semicolon:=True, Comma:=False, Space:=False, Other:=False, FieldInfo _
  25.         :=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), _
  26.         Array(7, 1)), TrailingMinusNumbers:=True
  27.    .[A:A].NumberFormatLocal = "m/d/yyyy" 'Åܧó¤é´Á®æ¦¡
  28. End With
  29. End With
  30. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 5# Hsieh
½Ð°Ý¥H¤UÀ³¸Ó­n«ç¼Ë­×§ï:
'¸ê®Æ­åªR

    .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

TOP

¦^´_ 6# donod

§A¿ý»s¤@­ÓAÄæ¥H¤À¸¹¬°¤À¹j²Å¸¹ªº¥¨¶°¬Ý¬Ý«Kª¾
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 7# Hsieh
¬O§_³o¼Ë°µ?
Book1.rar (10.38 KB)

TOP

¦^´_ 8# donod

play.gif
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 9# Hsieh
½Ð°Ý¿ù¦b¨º¸Ì
test A2.rar (15.55 KB)

TOP

        ÀR«ä¦Û¦b : ¤H­n¦Û·R¡A¤~¯à·R´¶¤Ñ¤Uªº¤H¡C
ªð¦^¦Cªí ¤W¤@¥DÃD