|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
请测试
- Sub YZC()
- Dim objXML As Object
- Application.ScreenUpdating = False
- Range("a3:n3000").ClearContents '删除内容
- 'URL = "http://quote.tool.hexun.com/hqzx/quote.aspx?type=2&market=0&sorttype=3&updown=up&page=1&count=28" & Format(Now, "00")
- URL = "http://datainterface.eastmoney.com/EM_DataCenter/JS.aspx?type=LHB&sty=YYHSIU&code=80032107&p=2&ps=30&js=var%20ZlHguMuK=1" & Format(Now, "00")
- 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
- Range("A3").Select
- ActiveSheet.Paste 'False '无条件覆盖
- Set objXML = Nothing
- [C1] = Right(Left(URL, 90), 8) '
- Application.ScreenUpdating = True
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|