- ©«¤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
|
¦^´_ 3# jack200217
§ó·s¤W±ªºµ{¦¡½X- Option Explicit
- Const ӪѤëÀ禬 = "http://goodinfo.tw/StockInfo/ShowSaleMonChart.asp?STOCK_ID="
- '¥[Åv«ü¼Æ ªk¤H¶R½æ¶W¤é²Îp¹Ï
- Const ªk¤H¶R½æ = "http://goodinfo.tw/StockInfo/ShowBuySaleChart.asp?CHT_CAT=DATE&STOCK_ID="
- '¥[Åv«ü¼Æ ¿Ä¸ê¿Ä¨é¾lÃB¤é²Îp¹Ï
- Const ¿Ä¸ê¿Ä¨é = "http://goodinfo.tw/StockInfo/ShowBearishChart.asp?CHT_CAT=DATE&STOCK_ID="
- Sub Ex() 'Goodinfo!¥xÆWªÑ¥«¸ê°Tºô
- Dim i As Integer, b As Object, E As Object, R As Integer, Ar, A As Variant
- Dim ie, Ay(), k As Integer, STOCK_ID As String, Msg As Boolean
- Do
- STOCK_ID = InputBox("¿é¤J ¥N¸¹", " ¥N¸¹", 3481)
- Loop Until Val(STOCK_ID) And Len(STOCK_ID) >= 4
- Ay = Array(ӪѤëÀ禬 & STOCK_ID, ªk¤H¶R½æ & STOCK_ID, ¿Ä¸ê¿Ä¨é & STOCK_ID)
- Set ie = CreateObject("InternetExplorer.Application")
- With ie
- .Visible = True
- For k = 1 To 3
- .Navigate Ay(k - 1)
- Do While .Busy Or .readyState <> 4: DoEvents: Loop
- With .Document.BODY
- If InStr(.INNERTEXT, "¬dµL") Then
- Msg = True
- GoTo Er
- End If
- End With
- Do
- Set E = .Document.getElementsByTagName("table")
- Loop While E Is Nothing
- If Sheets.Count < k Then Sheets.Add after:=Sheets(Sheets.Count)
- With Sheets(k)
- .Cells.Clear
- R = 1
- If k = 1 Then 'ӪѤëÀ禬
- Ar = Array(13, 20)
- ElseIf k = 2 Then 'ªk¤H¶R½æ
- Ar = Array(19, 22, 24, 31)
- Else '¿Ä¸ê¿Ä¨é
- Ar = Array(19, 22, 24, 30)
- End If
- For Each A In Ar
- For Each b In E(A).Rows
- For i = 0 To b.Cells.Length - 1
- ' If InStr(b.Cells(i).INNERTEXT, "¸ê®Æ¤é´Á: µL¥æ©ö¸ê®Æ") Then
- ' Msg = True
- ' GoTo Er
- ' End If
- .Cells(R, i + 1) = b.Cells(i).INNERTEXT
- Next
- R = R + 1
- Next
- R = R + 1
- Next
- End With
- Next
- Er: ' Title
- MsgBox Split(.Document.Title, "-")(0) & IIf(Msg, "¬dµL¬ÛÃö¸ê®Æ", " ¤U¸ü ok")
- .Quit 'Ãö³¬ºô¶
- End With
- End Sub
½Æ»s¥N½X |
|