|
这样看看!
- Sub YZC()
- Dim objXML As Object
- Dim i, j, r
- Application.ScreenUpdating = False
- Range("e3:n3000").ClearContents '删除内容
- For i = 2 To 4
- j = Cells(i, 4)
- URL = "http://datainterface.eastmoney.com/EM_DataCenter/JS.aspx?type=LHB&sty=YYHSIU&code=" & j & "&p=2&ps=50&js=var%20ZlHguMuK=1"
- Set objXML = CreateObject("Microsoft.XMLHTTP")
- With objXML
- .Open "GET", URL, False
- .send
- str1 = .responsetext
- End With
- Str2 = Split(Split(str1, "([""")(1), """])")(0)
- Str2 = Replace(Replace(Str2, """,""", Chr(10)), ",", Chr(9))
- With CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
- .SetText Str2
- .PutInClipboard
- End With
- With CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
- .SetText Str2
- .PutInClipboard
- End With
- Range("E" & (50 * (i - 2) + 2)).Select
- ActiveSheet.Paste 'False '无条件覆盖
- Set objXML = Nothing
- [C1] = Right(Left(URL, 90), 8) '
- Application.ScreenUpdating = True
- Next
- End Sub
复制代码 |
|