|
楼主 |
发表于 2015-10-29 09:12
|
显示全部楼层
根据15楼的 外套个循环
缺少对象TT
Format(Now, "00") 部分怎么加上去
帮看下的
Sub YZC()
Dim objXML As Object
Dim i, j, r
Application.ScreenUpdating = False
Range("e3: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")
For i = 2 To 100
j = xlapp.Cells(i, 4).Value
URL = "http://datainterface.eastmoney.com/EM_DataCenter/JS.aspx?type=LHB"
URL = URL & "&sty=YYHSIU"
URL = URL & "&code="
URL = URL & j
URL = URL & "&p=2"
URL = URL & "&ps=" & 50
URL = URL & "&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
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
|
|