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

¦³ÃöEXCEL VBA §ì¨ú¤£¨ì§¹¾ãºô§}CSV°ÝÃD

gbkee,c_c_lai±z¦n¡G

§Ú¤]¦³¤W­zªº°ÝÃD¡A¤]¬OÃÒ¥æ©Òºô¯¸°ÝÃD¡A¦ý¸Õ¤F«Ü¤[³£¨S¦³µ²ªG¡A¥i¥H½Ð±Ð°ª¤â¬O­þ¸Ì¥X¿ù¤F¶Ü? ÁÂÁ±z
http://www.twse.com.tw/ch/trading/exchange/TWT93U/TWT93U.php#
  1. Sub TEST123()
  2.     Dim YMD_day As String, N As Name, webURL As String
  3.     YMD_day = InputBox("¿é¤J ¥Á°ê¦~«×¤é´Á : 102/10/07", "¤U¸ü¯S©w¤é´Áªº¸ê®Æ", Format(Date - 1, "E/MM/DD"))
  4.     With Sheets("¤U¸ü¸ê®Æ")
  5.        For Each N In .Names
  6.             'N.Delete
  7.        Next
  8.         .Cells.Clear
  9.        GetData_URL = "URL;http://www.twse.com.tw/ch/trading/exchange/TWT93U/TWT93U.php?edition=ch&filename=genpage/A" & YMD_day & ".dat&type=csv"
  10.         'webURL = "URL; http://www.twse.com.tw/ch/trading/block/BFIAUU/BFIAUU.php?input_date=" & YMD_day & "&login_btn=¬d¸ß.dat"
  11.         With .QueryTables.Add(Connection:=GetData_URL, Destination:=.Range("A1"))
  12.             .WebSelectionType = xlSpecifiedTables
  13.             .WebFormatting = xlWebFormattingNone
  14.             .WebTables = "data_table"
  15.             .WebPreFormattedTextToColumns = True
  16.             .WebConsecutiveDelimitersAsOne = False
  17.             .WebSingleBlockTextImport = False
  18.             .WebDisableDateRecognition = False
  19.             .WebDisableRedirections = True
  20.             .Refresh BackgroundQuery:=False
  21.         End With
  22.     End With
  23. End Sub
½Æ»s¥N½X

TOP

¦³ÃöEXCEL VBA §ì¨ú¤£¨ì§¹¾ãºô§}CSV°ÝÃD

¦U¦ì°ª¤â±z¦n¡A

¦]­n§ì¥ý«e¤wª¦¤å¡Ahttp://forum.twbts.com/viewthread.php?tid=10770¡A­×§ï¹L«á¡A¸ê¤´±a¤£¥X¨Ó¡A½Ð·Q°Ý¦U¦ì°ª¤â¬O§_php«á­±ªº»yªk¨Ï¥Î¦³»~¡AÁÂÁ¤j®a^^

http://www.twse.com.tw/ch/trading/exchange/TWT93U/TWT93U.php
  1. Option Explicit
  2. Sub ExA()
  3.     With ActiveSheet
  4.         With .QueryTables.Add("URL;http://www.twse.com.tw/ch/trading/exchange/TWT93U/TWT93U.php#?combination_choice=sub&cno=1&input_date=103/02/25", .[A1])
  5.             .WebSelectionType = xlSpecifiedTables
  6.             .WebFormatting = xlWebFormattingNone
  7.             .WebTables = """data_table"""
  8.             .WebPreFormattedTextToColumns = True
  9.             .WebConsecutiveDelimitersAsOne = True
  10.             .WebSingleBlockTextImport = False
  11.             .WebDisableDateRecognition = False
  12.             .WebDisableRedirections = False
  13.             .Refresh BackgroundQuery:=False
  14.         End With
  15.     End With
  16. End Sub
½Æ»s¥N½X
  1. Sub TEST123()
  2.     Dim YMD_day As String, N As Name, webURL As String
  3.     YMD_day = InputBox("¿é¤J ¥Á°ê¦~«×¤é´Á : 102/10/07", "¤U¸ü¯S©w¤é´Áªº¸ê®Æ", Format(Date - 1, "E/MM/DD"))
  4.     With Sheets("¤U¸ü¸ê®Æ")
  5.        For Each N In .Names
  6.             'N.Delete
  7.        Next
  8.         .Cells.Clear
  9.        GetData_URL = "URL;http://www.twse.com.tw/ch/trading/exchange/TWT93U/TWT93U.php?edition=ch&filename=genpage/A" & YMD_day & ".dat&type=csv"
  10.         'webURL = "URL; http://www.twse.com.tw/ch/trading/block/BFIAUU/BFIAUU.php?input_date=" & YMD_day & "&login_btn=¬d¸ß.dat"
  11.         With .QueryTables.Add(Connection:=GetData_URL, Destination:=.Range("A1"))
  12.             .WebSelectionType = xlSpecifiedTables
  13.             .WebFormatting = xlWebFormattingNone
  14.             .WebTables = "data_table"
  15.             .WebPreFormattedTextToColumns = True
  16.             .WebConsecutiveDelimitersAsOne = False
  17.             .WebSingleBlockTextImport = False
  18.             .WebDisableDateRecognition = False
  19.             .WebDisableRedirections = True
  20.             .Refresh BackgroundQuery:=False
  21.         End With
  22.     End With
  23. End Sub
½Æ»s¥N½X

ÁÂÁ°ª¤â  ¤Ó·PÁ¤F

TOP

heavenweaver ±z¦n

§Ú¥Ø«e¦³¤G­Óºô§}
http://www.gretai.org.tw/ch/stock/statistics/monthly/st42.php
http://www.gretai.org.tw/ch/stock/statistics/monthly/st44.php

³£¬OÄÝ©ó¤W­zªºª¬ªp¡A§Ú·Q½Ð±Ð¤@¤U¡A¬O§_¦³¤u¨ã¥i¥H¬d¸ß?edition=ch&filename=genpage/A" & YMD_day & ".dat&type=csv" --ªº°Ñ¼Æ¸ê®Æ¥X¨Ó©O¡AÁÂÁÂ

TOP

ÁÂÁÂheavenweaver¡A¤S¾Ç¨ì¤@©Û¤F

TOP

        ÀR«ä¦Û¦b : ÁÀ¨¥¹³¤@¦·²±¶}ªºÂAªá¡A¥~ªí¬üÄR¡A¥Í©Rµu¼È¡C
ªð¦^¦Cªí ¤W¤@¥DÃD