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

Ãö©ó¶×¤J¥~³¡¸ê®Æªº°ÝÃD

Ãö©ó¶×¤J¥~³¡¸ê®Æªº°ÝÃD

½Ð°Ý¦U¦ì¥ý¶i
§Ú·Q±qºô­¶¶×¤J¥~³¡¸ê®Æ!!!¤@¯ë¶×¤Jªº¤è¦¡¨S¦³°ÝÃD
¦ý¬O·í¤@¨Çºô­¶»Ý­n¥ý³]©w¸ê®Æ½d³ò(¨Ò¦p¦~¥÷)¤~·|Åã¥Üªººô­¶
¸Ó«ç»ò¤U¸ü©O?
¨Ò¦p:http://mops.twse.com.tw/mops/web/t163sb06

§Úª¦¤F¤@¨Ç¤å¤]§ä¤F¤@¨Çºô­¶!!³o¦ü¥G¬O¸ò"Internet Explorerª«¥ó±±¨îDOM"¦³Ãö«Y!!

§Ú¸Õ¹L¤U¸ü"http://mops.twse.com.tw/nas/t21/sii/t21sc03_104_1_0.html"³oÃþ¸ê®Æªº¤è¦¡
¥u­n§ó§ï¾ã¦êºô§}¦C¤¤ªº¬Y¨Ç¼Æ¾Ú!!«K¯à¶¶§Q¤U¸ü~~¦ý¬O»Ý­n§ó§ï¨Ç±±¨î¶µªººô­¶!!
½Ð±Ð¸Ó«ç»ò¤U¸ü©O?

¥»©«³Ì«á¥Ñ GBKEE ©ó 2016-4-18 10:50 ½s¿è

¦^´_ 1# laieven
¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Sub Ex_Àç¯q¤ÀªR¬d¸ß·JÁ`ªí() '¤½¶}¸ê°TÆ[´ú¯¸
  3.     Dim i As Variant, E As Object, Op As String, Sh As Worksheet, R As Integer, C As Integer
  4.     Application.StatusBar = "'** µ¥­Ôºô­¶ ....**"
  5.     With CreateObject("InternetExplorer.Application")
  6.   '    .Visible = True
  7.         .Navigate "http://mops.twse.com.tw/mops/web/t163sb06"
  8.         Do While .Busy Or .ReadyState <> 4: DoEvents: Loop
  9.          '[¤W¥«§O] *****
  10.         With .document.ALL("TYPEK")(1)
  11.             For i = 0 To .ALL.Length - 1
  12.                 Op = Op & vbLf & i + 1 & .ALL(i).INNERTEXT
  13.             Next
  14.             DoEvents  ' ** ¦^¨ì Excel
  15.             Do
  16.                 Application.ActiveWindow.Activate
  17.                 i = Application.InputBox(Op, "Àç¯q¤ÀªR¬d¸ß·JÁ`ªí  [¤W¥«§O]", 1, Type:=1)
  18.                
  19.                 If i = 0 Then GoTo Exit_Sub
  20.             Loop Until i <= .ALL.Length And i >= 1
  21.             .selectedindex = i - 1
  22.         End With
  23.         '[¦~«×] *****
  24.         Do
  25.             i = Application.InputBox(Format(Date, "ee"), "Àç¯q¤ÀªR¬d¸ß·JÁ`ªí  [¦~«×]", Format(Date, "ee") - 1, Type:=1)
  26.             If i = 0 Then GoTo Exit_Sub
  27.           Loop Until i <= Format(Date, "ee")
  28.         .document.ALL("year").Value = i
  29.         '[©u§O] *****
  30.         Do
  31.             i = Application.InputBox(1, "Àç¯q¤ÀªR¬d¸ß·JÁ`ªí  [©u§O]", DatePart("q", Date), Type:=1)
  32.             If i = 0 Then GoTo Exit_Sub
  33.           Loop Until i <= 4 And i >= 1
  34.         .document.ALL("season").selectedindex = i
  35.         '** ºô­¶  «ö¤U [·j´M]
  36.         For Each E In .document.ALL.tags("INPUT")
  37.             If E.Value = " ·j´M " Then
  38.                 E.Click
  39.                 Exit For
  40.             End If
  41.         Next
  42.         '** µ¥­Ôºô­¶ ¸ü¤J¸ê®Æ
  43.         Application.StatusBar = "'** µ¥­Ôºô­¶ ¸ü¤J¸ê®Æ**"
  44.         Do
  45.             Set E = .document.BODY.ALL.tags("table")(11).Rows
  46.             If InStr(.document.BODY.INNERTEXT, "¬d¸ßµL¸ê®Æ") Then
  47.                 MsgBox "¬d¸ßµL¸ê®Æ"
  48.                 Application.StatusBar = "** ºô­¶  ¬d¸ßµL¸ê®Æ**"
  49.                 GoTo Exit_Sub:
  50.             End If
  51.              DoEvents:
  52.         Loop Until E.Length > 11
  53.           '** ¤U¸ü ¸ê®Æ
  54.           Set Sh = Sheets(2)  '«ü©w ¤u§@ªí
  55.           Application.ScreenUpdating = False
  56.           Application.StatusBar = "'** ¸ü¤J¸ê®Æ ¤¤ **"
  57.           Set E = .document.BODY.ALL.tags("table")(11).Rows
  58.          
  59.           Sh.UsedRange.Clear
  60.           For R = 0 To E.Length - 1
  61.                      For C = 0 To E(R).Cells.Length - 1
  62.                      If R > 1 And E(R).Cells(0).INNERTEXT = "¤½¥q¥N¸¹" Then Exit For
  63.                           Sh.Cells(R + 1, C + 1) = E(R).Cells(C).INNERTEXT
  64.                      Next
  65.             Next
  66.           Sh.UsedRange.SpecialCells(xlCellTypeBlanks).Delete
  67.           Sh.Activate
  68.           Sh.[A1].Select
  69.           Application.ScreenUpdating = True
  70.           Application.StatusBar = .document.BODY.ALL.tags("table")(12).INNERTEXT
  71. Exit_Sub:
  72.         .Quit        'Ãö³¬ºô­¶
  73.     End With
  74. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 2# GBKEE


    ·PÁ¨ó§U!!!§Ú¨Ó¸Õ¬Ý¬Ý!!

TOP

½Ð°Ý«ç»ò·|°õ¦æ¿ù»~9°}¦C¯Á¤Þ¶W¥X½d³ò

TOP

        ÀR«ä¦Û¦b : ¥Ç¿ù¥XÄb®¬¤ß¡A¤~¯à²M²bµL·Ð´o¡C
ªð¦^¦Cªí ¤W¤@¥DÃD