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

¦³¿ìªk¨Ï¥Îvba¶×¤J¥~³¡web¸ê®Æ¶Ü¡H

¦^´_ 10# fei6999

¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Sub ­Ó§O²{ª÷¬y¶qªí()
  3.     Dim Sh As Worksheet
  4.     With CreateObject("InternetExplorer.Application")
  5.         .Navigate "http://mops.twse.com.tw/mops/web/t164sb05"
  6.         .Visible = True
  7.         Do While .Busy Or .readyState <> 4: DoEvents: Loop
  8.         With .Document
  9.             .getElementsByTagName("input")(38).Value = "5349"  '³o¸Ì­×§ï ªÑ²¼¥N¸¹
  10.             .getElementsByTagName("input")(41).Click
  11.         End With
  12.         Do While .Busy Or .readyState <> 4: DoEvents: Loop
  13.       
  14.       '******************************
  15.        .Document.body.innerHTML = .Document.getElementsByTagName("table")(3).outerHTML
  16.         .ExecWB 17, 2       '  Select All
  17.         .ExecWB 12, 2       '  Copy selection
  18.         .Quit
  19.         End With
  20.         '****************************
  21.         Set Sh = Sheets(1)
  22.         Sh.UsedRange.Clear
  23.         With Sheets.Add(, Sheets(Sheets.Count))
  24.             .Range("A1").Select
  25.             .PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:=False, NoHTMLFormatting:=True
  26.             .Range("C:D,P:P").Copy Sh.[A1]
  27.             Application.DisplayAlerts = False
  28.             .Delete
  29.             Application.DisplayAlerts = True
  30.         End With
  31.         With Sh
  32.             .Activate
  33.             .Rows("1:11").Delete
  34.             .UsedRange.EntireColumn.AutoFit
  35.         End With
  36.       
  37. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ¤Hªº¤ß¦a¬O¤@²¥¥Ð¡A¤g¦a¨S¦³¼½¤U¦nºØ¤l¡A¤]ªø¤£¥X¦nªºªG¹ê¡C -
ªð¦^¦Cªí ¤W¤@¥DÃD