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

[µo°Ý] ¦p¦ó¥ÎÅܼƨú¥N¸ô®|¤å¦r

[µo°Ý] ¦p¦ó¥ÎÅܼƨú¥N¸ô®|¤å¦r

¥»©«³Ì«á¥Ñ dreamsway ©ó 2018-10-25 21:17 ½s¿è

¦U¦ì«e½ú¦n¡A§Ú³z¹L¿ý»s¥¨¶°ªº¤è¦¡°O¿ý¤F¶×¤J¥~³¡¸ê®Æªº°Ê§@¡A§e²{¥H¤U¤º®e
  1.     'With ActiveSheet.QueryTables.Add(Connection:= _
  2.         "TEXT;C:\API\20181018\TXFK8\20181018_Match.txt", Destination:=Range("$A$2"))
  3.         .name = "20181018_Match"
½Æ»s¥N½X
·Q¸ß°Ý¦p¦ó³z¹LÅܼƪº¤è¦¡¨Ó¨ú¥N¸ô®|ªº¤å¦r©O¡H
¨ä¤¤20181018³o­Ó¼Æ¦r¬°·í¤éªº¤é´Á¡BTXFK8³o­Ó¤å¦r¬°Sht1.Range("A4")Àx¦s®æ¤ºªº¤å¦r
ª¦¤F±Ð¾Ç¤å³¹«á¸ÕµÛ¼g¥X¥H¤U¤º®e
  1. Dim d As Date, n As String
  2. d = DateValue '¦n¹³­nµ¹®æ¦¡½d¨Ò
  3. n = Sht1.Range("A4")

  4.     With ActiveSheet.QueryTables.Add(Connection:= _
  5.         "TEXT;C:\" & "API" & "\" & d & "\"& n & "\" & d & "_Match.txt"", Destination:=sht2.Range("$A$2"))
  6.         .name = "d & "_Match""
½Æ»s¥N½X
¦¹¥¨¶°¨S¤ÏÀ³¡A¤×¨ä¬O_Match³o­Ó©³½u¤@ª½Åã¥Ü¬°¤£¥¿½T¦r¤¸
½Ð°Ý¸Ó¦p¦ó½Õ¾ã©O¡AÁÂÁ¡I

Dim d As String, n As String
d = Format(Date, "yyyymmdd")
n = Sht1.Range("A4")
With ActiveSheet.QueryTables.Add(Connection:= _
    "TEXT;C:\API\" & d & "\" & n & "\" & d & "_Match.txt", Destination:=sht2.Range("A2"))
    .Name = d & "_Match"

End With

TOP

¸Õ¸Õ
"TEXT;C:\API\"& Year(Now) & Month(Now) & Day(Now) &"\" & SHEET1.RANGE("A4") & "\" & Year(Now) & Month(Now) & Day(Now)&"_Match.txt"
ù

TOP

ÁÂÁ¨â¦ì«e½úªº¤À¨É¡A¤p§Ì¹q¸£ªºOFFICE­è¦w¸Ë¤F·sª©¥»¡A¤¶­±¾Þ§@¦³¨Ç³\¤£¦P¡A©Èµ{¦¡¥N½X¤]¸òµÛ¨Ç·L¤£¦P¡A«Ý½T»{«á¦A¦^´_«áÄò¡AÁÂÁ¡I

TOP

        ÀR«ä¦Û¦b : ¤@­Ó¤Hªº§Ö¼Ö¡D¤£¬O¦]¬°¥L¾Ö¦³±o¦h¡A¦Ó¬O¦]¬°¥L­p¸û±o¤Ö¡C
ªð¦^¦Cªí ¤W¤@¥DÃD