¦U¦ì¦n
µ{¦¡½X¦p¤U¡A¤U¸ü¸ê®Æ«á¡A¬OªÅªÅªº¡A¤£ª¾¸Ó§ïþ
©Ò¥H·Q½Ð¦U¦ìÀ°À°¦£
ÁÂÁÂ!! ·P®¦- Sub abc()
- Dim Theurl As String, Sdate
- Dim URL As String, xDate As String, A As Date
- A = Range("A2").Value
- xDate = Format(A, "E/MM/DD")
- Theurl = "http://www.otc.org.tw/ch/stock/3insti/DAILY_TradE/3itrade_download.php?t=D&d=" & xDate & "&s=0"
- With ActiveSheet.QueryTables.Add(Connection:="URL;" & Theurl, Destination:=Range("B3"))
- .BackgroundQuery = True
- .RefreshStyle = xlOverwriteCells
- .RefreshPeriod = 0
- .AdjustColumnWidth = False
- .WebSelectionType = xlSpecifiedTables
- .WebFormatting = xlWebFormattingNone
- '.WebTables = "1,2,3,4"
- .WebDisableDateRecognition = True 'Ãö³¬¤é´Á¿ëÃÑ
- .Refresh BackgroundQuery:=False
- .ResultRange.Columns(1).TextToColumns Destination:=.ResultRange.Cells(1), DataType:=xlDelimited, _
- TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
- Semicolon:=False, Comma:=True, 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), Array(8, 1), Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1 _
- ), Array(14, 1), Array(15, 1), Array(16, 1), Array(17, 1), Array(18, 1), Array(19, 1), Array _
- (20, 1)), TrailingMinusNumbers:=True
- 'TextToColumns ¤èªk (¸ê®ÆåªR)ªº°Ñ¼Æ¥i¿ý»s±o¨ì
- 'ResultRange.Columns(1):weby¸ê®Æªº²Ä¤@Äæ
- 'ResultRange.Cells(1) :weby¸ê®Æªº²Ä¤@ÓCells(Àx¦s®æ)
- '.Delete
-
-
- End With
- End Sub
½Æ»s¥N½X |