- ©«¤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
|
¦^´_ 6# Scott090
¤£¿ùªº³o¼Ë´N¥i¥H±o¨ì§¹¾ã¸ê®Æ.
µ{¦¡°õ¦æ®É¶¡¤j¬ù»Ý¤@¤ÀÄÁ,§Ú¾ã²z¤@¤U¦bª¬ºA¦C¤W¥[¤W¸ê°T.- Option Explicit
- Dim Sh As Worksheet
- Dim xTimer As Date
- 'Dim Timer As Date 'Timer ¬°vbaªº¤º«Ø¨ç¼Æ ,ÅܼƦWºÙºÉ¶q¤£n¬Û¦P
- Sub Ex_ºô¶©³³¡()
- Dim E As Object, Ie_Date As Date, i As Integer
- Application.DisplayStatusBar = True
- Application.StatusBar = False
- Set Sh = ActiveSheet
- Sh.Cells.Clear
- On Error GoTo EE
- With CreateObject("InternetExplorer.Application")
- '.Visible = True
- xTimer = Time
- .Navigate "https://finance.yahoo.com/quote/AAPL/history?period1=915206400&period2=1505174400&interval=1d&filter=history&frequency=1d"
- Do While .Busy Or .readyState <> 4: DoEvents: Application.StatusBar = "****** µ¥ Ô ºô ¶ ¤U....¡¹¡¹¡¹" & GetTime: Loop
- Ie_Date = Getdate(.document.ALL.TAGS("INPUT")(4).Value)
- Set E = .document.ALL.TAGS("tr")
- Do
- Application.StatusBar = "¡¹¡¹¡¹¡¹¡¹ ¸ê®Æ ¤U¸ü¤¤..." & GetTime & String(Val(GetTime), "¡¹")
- .document.Parentwindow.scrollby 0, 37900
- ' Do While .Busy Or .readyState <> 4: DoEvents: Loop
- If Getdate(E(E.Length - 2).Cells(0).innertext) - Ie_Date < 5 Then Exit Do
- DoEvents
- Loop
- Set E = .document.ALL.TAGS("TABLE")(1)
-
- Ep .document.ALL.TAGS("TABLE")(1).outerHTML
- Application.StatusBar = "** ¡¹" & xTimer & " - " & Time & "¡¹" & GetTime & " ,¤U¸ü ¦@ " & E.Rows.Length - 2 & " µ§¸ê®Æ §¹²¦ !! **"
- .Quit 'Ãö³¬ºô¶
- End With
- With Sh
- For i = 2 To .Range("A1").End(xlDown).Row - 1
- .Range("A" & i) = Getdate(.Range("A" & i))
- Next
- .Range("A:A").NumberFormatLocal = "yyyy/mm/dd"
- End With
-
- Exit Sub
- EE: 'µ{¦¡¹B¦æ³t«×¤j©óie®Éªº±¹¬I
- Application.StatusBar = "ºô¶¿ù»~µ¥Ô¤¤....¡¹¡¹¡¹ " & GetTime
- Application.Wait (Second(Now()) + 2)
- Resume
- End Sub
- Private Sub Ep(S As String)
- With CreateObject("InternetExplorer.Application")
- .Navigate "about:Tabs"
- ' .Visible = True
- .document.body.innerHTML = S
- .ExecWB 17, 2 ' Select All
- .ExecWB 12, 2 ' Copy selection
- With Sh
- .Activate
- ' .Cells.Clear
- .Range("A1").Select
- .PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:=False, NoHTMLFormatting:=True
- .Range("A1").Select
- End With
- .Quit
- End With
- End Sub
- Private Function Getdate(sDate As String) As Date
- Dim A As String, b As Integer
- A = Split(sDate, "-")(0)
- b = AscW(Mid(A, 1, 1))
- A = Replace(A, ChrW(b), " ")
- A = Replace(A, "?", "")
- Getdate = CDate(A)
- End Function
- Private Function GetTime() As String
- GetTime = Application.Text(Time - xTimer, " [S]’")
- End Function
½Æ»s¥N½X |
|