腾讯股票查询是有接口的,很简单的http://qt.gtimg.cn/q=sz代码 Sub test() For r = 3 To Range("A1").CurrentRegion.Rows.Count URL = "http://qt.gtimg.cn/q=sz" & Cells(r, 1).Value With CreateObject("msxml2.xmlhttp") .Open "GET", URL, False .send sp = Split(.responsetext, "~") If UBound(sp) > 3 Then Cells(r, 3).Value = sp(3) Cells(r, 4).Value = Format(sp(30), "0000-00-00 00:00:00") Else Cells(r, 3).Value = "代码错啦!" End If End With NextEnd Sub 如果弄不懂代码,可按以下图片动画演示操作,比较简单(如图片未动、请点击图片以获得详细演示过程):
|