- ©«¤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# s13983037
¸Õ¸Õ¬Ý- Option Explicit
- Private Sub CommandButton1_Click()
- Dim E As Object, i As Integer, ii As Integer, k As Integer
- Dim StockArr(), A As Variant, Sh As Worksheet
- StockArr = Array(9946, 2330, 2317, 5522) 'µ¥µ¥ªºªÑ²¼
- Set Sh = ActiveSheet
- Sh.UsedRange.Clear
- With CreateObject("InternetExplorer.Application")
- .Visible = True
- k = 1
- For Each A In StockArr
- .Navigate "http://www.cnyes.com/twstock/intro/" & A & ".htm"
- Do While .Busy Or .ReadyState <> 4: DoEvents: Loop
- Sh.Cells(k, 1) = Split(.document.Title, "_")(0) 'ªÑ²¼:¦WºÙ¥N¸¹
- Set E = .document.getElementsByTAGName("TABLE")(4)
- For i = 0 To E.Rows.Length - 1
- k = k + 1
- For ii = 0 To E.Rows(i).Cells.Length - 1
- Sh.Cells(k, ii + 1) = E.Rows(i).Cells(ii).INNERTEXT
- Next
- Next
- '**************************************************************
- .Navigate "http://pchome.megatime.com.tw/stock/sid" & A & ".html"
- Do While .Busy Or .ReadyState <> 4: DoEvents: Loop
- Set E = .document.getElementsByTAGName("TABLE")(4)
- For i = 0 To E.Rows.Length - 1
- k = k + 1
- For ii = 0 To E.Rows(i).Cells.Length - 1
- Sh.Cells(k, ii + 1) = E.Rows(i).Cells(ii).INNERTEXT
- Next
- Next
- k = k + 2
- Next
- .Quit 'Ãö³¬ºô¶
- End With
- With Sh.Range("a:a")
- .Replace "¬ÛÃöÅvµý", "=500/0" '²£¥Í¿ù»~ªº¤½¦¡
- If Not .Find("#DIV/0!", LookIn:=xlValues) Is Nothing Then
- .SpecialCells(xlCellTypeFormulas, xlErrors).EntireRow.Delete
- End If
- End With
- End Sub
½Æ»s¥N½X |
|