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

[µo°Ý] ½Ð°Ý¦p¦ó¥[§ÖªÑ»ù§ó·s?

[µo°Ý] ½Ð°Ý¦p¦ó¥[§ÖªÑ»ù§ó·s?

§ó·sªÑ»ù®É EXCEL·|µo¥Í(¨S¦³¦^À³)


ªÑ²¼°O±b.zip (394.23 KB)

¦^´_ 1# zzoo123
³oºô§}¥ÎQueryTable¶Ç¸ê®Æ«ÜºC,§ï¥ÎIEŪ¨ú§Ö¨Ç
  1. '§ó·s«ö¶s
  2. Private Sub CommandButton2_Click() '
  3.     Application.enableEvents = False   
  4.     'Åã¥Ühome¤u§@ªí
  5.     Sheets("home").Activate
  6.     '°õ¦æ§ó·sªÑ»ùµ{§Ç
  7.     updatePrice
  8.      Application.enableEvents = True
  9. End Sub
½Æ»s¥N½X
  1. Sub getData(stockCode As String)
  2.     Dim Sh As Worksheet, ie
  3.     Dim i As Integer, R As Integer, C As Integer
  4.     Set Sh = ThisWorkbook.Worksheets("temp") '.Cells.Delete
  5.     Sh.UsedRange.Clear
  6.     With CreateObject("InternetExplorer.Application")
  7.         '.Visible = True
  8.         .Navigate "http://tw.stock.yahoo.com/q/q?s=" & stockCode
  9.         Do While .Busy Or .readyState <> 4: DoEvents: Loop
  10.         Set E = .Document.all.tags("TABLE")
  11.         For i = 0 To E.Length - 1
  12.             If InStr(E(i).innerText, "¥[¨ì§ë¸ê²Õ¦X") And InStr(E(i).innerText, "¦¨¥æ©ú²Ó") And E(i).Rows.Length > 1 Then
  13.                 For R = 0 To E(i).Rows.Length - 1
  14.                     For C = 0 To E(i).Rows(R).Cells.Length - 1
  15.                         Sh.Cells(R + 2, C + 1) = E(i).Rows(R).Cells(C).innerText
  16.                     Next
  17.                 Next
  18.             End If
  19.         Next
  20.         .Quit        'Ãö³¬ºô­¶
  21.     End With
  22. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

·PÁÂÀ°¦£ ªGµM¶¶¦h¤F

TOP

        ÀR«ä¦Û¦b : ¤p¨Æ¤£°µ¡B¤j¨ÆÃø¦¨¡C
ªð¦^¦Cªí ¤W¤@¥DÃD