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

EXCEL VBA ¶×¤Jgoodinfoºô­¶¸ê®Æ

EXCEL VBA ¶×¤Jgoodinfoºô­¶¸ê®Æ

¦³©¯google¨ìª©¤jGBKEEªº¤å³¹
¸ÕµÛ¥h¬d¸ßhttp://www.goodinfo.tw/stockinfo/ShowK_ChartFlow.asp?RPT_CAT=DR_3M&STOCK_ID=2454&CHT_CAT=MONTH
¦ý·|¦³ª«¥ó¿ù»~


Option Explicit
Sub goodinfo()
    Dim A As Object, i As Integer, C As Variant, Sh As Worksheet, Stock As String
    Do
        Stock = InputBox("¿é¤JªÑ²¼¥N¸¹", "ªÑ²¼¥N¸¹", 2303)
    Loop Until Len(Stock) >= 4
    Set Sh = ActiveSheet                   '¥i«ü©w¤u§@ªí
    With CreateObject("InternetExplorer.application")
        .Navigate "http://www.goodinfo.tw/stockinfo/ShowK_ChartFlow.asp?RPT_CAT=DR_3M&STOCK_ID=" & Stock & "&CHT_CAT=MONTH"
        .Visible = True
        Do While .Busy Or .ReadyState <> 4
             DoEvents
        Loop
        Sh.Cells.Clear
        Set A = .Document.getelementsbytagname("table")(0)
        For i = 0 To A.Rows.Length - 1
            For C = 0 To A.Rows(i).Cells.Length - 1
                ActiveSheet.Cells(i + 1, C + 1) = A.Rows(i).Cells(C).innertext
            Next
        Next
        Set A = .Document.getelementbyid("content")
        For i = 0 To A.Rows.Length - 1
            For C = 0 To A.Rows(i).Cells.Length - 1
                ActiveSheet.Cells(i + 4, C + 1) = A.Rows(i).Cells(C).innertext
            Next
        Next
        Sh.UsedRange.EntireColumn.AutoFit
       .Quit
    End With
    MsgBox "OK"
End Sub

Sorry, ¸É¥R¤@¤U¤º®e  ¥D­n¬O­n¬d¸ß
ºô­¶©³¤Uªºªí®æ
http://www.goodinfo.tw/stockinfo/ShowK_ChartFlow.asp?RPT_CAT=DR_3M&STOCK_ID=3406&CHT_CAT=MONTH

TOP

¦^´_ 2# chickout2

¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Sub EX()
  3.     Dim i As Integer, E As Object, C As Integer, Sh As Worksheet
  4.     With CreateObject("InternetExplorer.Application")
  5.         .Visible = True
  6.         .Navigate "http://www.goodinfo.tw/stockinfo/ShowK_ChartFlow.asp?RPT_CAT=DR_3M&STOCK_ID=2454&CHT_CAT=MONTH"
  7.         Do While .Busy Or .readyState <> 4: DoEvents:      Loop
  8.         With .DOCUMENT
  9.             Do
  10.                 If .all.tags("table").Length >= 16 Then Exit Do
  11.                 DoEvents
  12.             Loop
  13.             Set Sh = ActiveSheet
  14.             Sh.UsedRange.Clear
  15.             For Each E In .all.tags("table")(16).Rows
  16.                 i = i + 1 '
  17.                 For C = 0 To E.Cells.Length - 1
  18.                     Sh.Cells(i, C + 1) = E.Cells(C).innertext
  19.                 Next
  20.             Next
  21.             With Sh
  22.                  For i = 21 To .Range("A" & Rows.Count).End(xlUp).Row Step 18
  23.                     .Cells(i, "A").Resize(2).EntireRow.Delete
  24.                 Next
  25.             End With
  26.         End With
  27.         .Quit        'Ãö³¬ºô­¶
  28.     End With
  29. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

ÁÂÁª©¥D, ¥i¥H¹B¦æ
³o´X¤Ñ°µ¤F¤£¤Ö¥\½Ò
¤£¹LÁÙ¬OµLªk§¹¦¨
¬Ý¤Fª©¥Dªº¥N½X«á¾Ç¤F¤£¤Ö
ÁÂÁ À°¦£

TOP

[ª©¥DºÞ²z¯d¨¥]
  • GBKEE(2016/6/15 09:57): ¥i¤W¶Ç§Avba ¬Ý¬Ý

½Ð±Ðª©¤j¡A ¦pªG­n±N 3­Ó¤£¦Pªººô­¶¸ê®Æ ©ñ¦b¦P¤@­Ó¤u§@­¶¸Ì¡A VBA­n¦p¦ó§ï¡C
²Ä¤@­Óºô­¶¸ê®Æ±q²Ä 1¦C¶}©l©ñ¡A¸ê®Æ ¦@35¦æ¡C
²Ä¤G­Óºô­¶¸ê®Æ±q²Ä40¦C¶}©l©ñ¡A¸ê®Æ ¦@41¦æ¡C  
²Ä¤T­Óºô­¶¸ê®Æ±q²Ä90¦C¶}©l©ñ¡A¥u­nÂ^¨úºô­¶«e30¦æªº¸ê®Æ ¡C

http://www.taifex.com.tw/chinese/3/7_12_3_tbl.asp  (35¦æ)
http://www.taifex.com.tw/chinese/3/7_12_5_tbl.asp  (41¦æ)
http://www.taifex.com.tw/chinese/3/7_8_tbl.asp    («e30¦æ)

TOP

        ÀR«ä¦Û¦b : ºw¤ô¦¨ªe¡C²É¦Ì¦¨ÅÚ¡A¤Å»´¤vÆF¡A¤Å¥Hµ½¤p¦Ó¤£¬°¡C
ªð¦^¦Cªí ¤W¤@¥DÃD