- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
        
|
¦^´_ 1# zzoo123
³oºô§}¥ÎQueryTable¶Ç¸ê®Æ«ÜºC,§ï¥ÎIEŪ¨ú§Ö¨Ç- '§ó·s«ö¶s
- Private Sub CommandButton2_Click() '
- Application.enableEvents = False
- 'Åã¥Ühome¤u§@ªí
- Sheets("home").Activate
- '°õ¦æ§ó·sªÑ»ùµ{§Ç
- updatePrice
- Application.enableEvents = True
- End Sub
½Æ»s¥N½X- Sub getData(stockCode As String)
- Dim Sh As Worksheet, ie
- Dim i As Integer, R As Integer, C As Integer
- Set Sh = ThisWorkbook.Worksheets("temp") '.Cells.Delete
- Sh.UsedRange.Clear
- With CreateObject("InternetExplorer.Application")
- '.Visible = True
- .Navigate "http://tw.stock.yahoo.com/q/q?s=" & stockCode
- Do While .Busy Or .readyState <> 4: DoEvents: Loop
- Set E = .Document.all.tags("TABLE")
- For i = 0 To E.Length - 1
- If InStr(E(i).innerText, "¥[¨ì§ë¸ê²Õ¦X") And InStr(E(i).innerText, "¦¨¥æ©ú²Ó") And E(i).Rows.Length > 1 Then
- For R = 0 To E(i).Rows.Length - 1
- For C = 0 To E(i).Rows(R).Cells.Length - 1
- Sh.Cells(R + 2, C + 1) = E(i).Rows(R).Cells(C).innerText
- Next
- Next
- End If
- Next
- .Quit 'Ãö³¬ºô¶
- End With
- End Sub
½Æ»s¥N½X |
|