- ©«¤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# gelai01000001
¤U¸ü3¦~¾ú¥vªÑ»ùªº¸ê®Æ- Option Explicit
- Sub ¹d¦ëºô_¾ú¥v¦æ±¡()
- Dim Sh As Worksheet, Code As String, d_Start As String, d_End As String
- Dim A As Object, i As Integer, c As Integer, T As Date
- Code = InputBox("¿é¤JªÑ²¼¥N¸¹ : ", "ªÑ²¼¥N¸¹", 2303)
- d_End = InputBox("¿é¤Jµ²§ô¤é´Á : ", "µ²§ô¤é´Á", Date)
- If Len(Code) <= 3 Or Not IsDate(d_End) Then Exit Sub
- Set Sh = ActiveSheet
- With Sh
- .UsedRange.Clear
- .[a1] = Code
- .[b1] = DateAdd("yyyy", -3, d_End) '¤U¸ü3¦~¾ú¥vªÑ»ùªº¸ê®Æ
- .[C1] = d_End
- Code = .[a1]
- d_Start = Format(.[b1], "yyyy/mm/dd")
- d_End = Format(.[C1], "yyyy/mm/dd")
- End With
- With CreateObject("InternetExplorer.application")
- .Navigate "http://www.cnyes.com/twstock/ps_historyprice/" & Code & ".htm"
- '.Visible = True
- Application.StatusBar = Code & " ¾ú¥v¦æ±¡ µ¥Ô¤¤..."
- Do While .Busy Or .ReadyState <> 4
- DoEvents
- Loop
- Set A = .Document.getelementsbytagname("input")
- A(5).Value = d_Start
- A(6).Value = d_End
- A(7).Click
- T = Time
- Do
- DoEvents
- Loop Until Time > T + #12:00:08 AM#
- Set A = .Document.getelementsbytagname("table")(1)
- Application.StatusBar = Code & " ¾ú¥v¦æ±¡ ¤U¸ü¤¤..."
- Cells(2, 1) = .Document.getelementsbytagname("span")(79).innertext
- For i = 0 To A.Rows.Length - 1
- For c = 0 To A.Rows(i).Cells.Length - 1
- Sh.Cells(i + 3, c + 1) = A.Rows(i).Cells(c).innertext
- Next
- Next
- .Quit
- End With
- Application.StatusBar = Code & " ¾ú¥v¦æ±¡ " & Application.Text(Time - T, "[S] ¬í") & " ¤U¸ü§¹¦¨"
- MsgBox "OK"
- Application.StatusBar = False
- End Sub
½Æ»s¥N½X |
|