- ©«¤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# espionage
Application.Wait Now + #12:00:10 AM# '¦bµ{¦¡¤¤'µ¥Ô10¬í
µ¥Ô10¬í ¤£¤@©wµ¥ªº¨ì- Option Explicit
- Sub Ex()
- Dim mysearchrange As Integer, mysearchdate As String, xR As Integer, xC As Integer
- Dim xTable As Object, A As Object, C As Object, myopt As Object
- For mysearchrange = 2 To 3 '³]©wn´M§äªº¤é´Á
- mysearchdate = Sheets("Á`ªí").Cells(mysearchrange, 5) '¤é´Á®æ¦¡ yyyy-mm-dd
- With CreateObject("InternetExplorer.Application")
- .Visible = True
- .Navigate "http://www.cnyes.com/twstock/a_technical2.aspx"
- Do While .Busy Or .readyState <> 4: DoEvents: Loop
- With .Document
- '--------------------¿é¤Jn¬d¸ßªºªÑ²¼¥«³õ
- For Each A In .getElementsByTagName("SELECT")
- If A.Name = "ctl00$ContentPlaceHolder1$D1" Then
- For Each myopt In A.Options
- If myopt.innertext = "¶°¤¤¥«³õ" Then
- myopt.Selected = True
- GoTo SeLe1
- End If
- Next
- End If
- Next
- SeLe1: '-------------------¿é¤Jn¬d¸ßªº¤é´Á½d³ò
- For Each A In .getElementsByTagName("SELECT")
- If A.Name = "ctl00$ContentPlaceHolder1$D3" Then
- For Each myopt In A.Options
- If myopt.innertext = mysearchdate Then
- myopt.Selected = True
- A.fireEvent ("onchange")
- GoTo SeLe2
- End If
- Next
- End If
- Next
- SeLe2:
- End With
- Do While .Busy Or .readyState <> 4: DoEvents: Loop
- Do Until InStr(.Document.getElementByid("ctl00_ContentPlaceHolder1_UpdatePanel1").innertext, mysearchdate)
- 'µ¥Ô¤U¸ü:«üq¤é´Á¸ê®Æ
- DoEvents
- Loop
- Set xTable = .Document.getElementsByTagName("TABLE")(1)
- ActiveSheet.UsedRange.Clear
- For Each A In xTable.Rows 'TableªºRowsª«¥ó¶°¦X
- xR = xR + 1 '¤U¤@¦C¸¹
- xC = 1
- For Each C In A.Cells 'TableªºRowª«¥óªºCellsª«¥ó¶°¦X
- Cells(xR, xC) = C.innertext
- xC = xC + 1
- Next
- Next
- End With
- Next
- End Sub
½Æ»s¥N½X |
|