|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
我的表是这样,提不出数据,求老师帮忙
Sub test()
For r = 3 To Range("A1").CurrentRegion.Rows.Count
dm = Cells(r, 5).Value
If Val(dm) < 600000 Then
URL = "http://qt.gtimg.cn/q=sz" & dm
Else
URL = "http://qt.gtimg.cn/q=sh" & dm
End If
With CreateObject("msxml2.xmlhttp")
.Open "GET", URL, False
.send
sp = Split(.responsetext, "~")
If UBound(sp) > 3 Then
Cells(r, 7).Value = sp(3)
Cells(r, 8).Value = Format(sp(30), "0000-00-00 00:00:00")
Else
Cells(r, 7).Value = "证券代码错啦!"
End If
End With
Next
End Sub
| | | | 证券代码 | 证券名称 | 最新价格 | 时间 | | | | | | | | | file:///C:/Users/20150808/AppData/Local/Temp/msohtmlclip1/01/clip_image001.png | | | | | | 002045 | 国光电器 | | | | | | | | | | 002056 | 横店东磁 | | | | | | | | | | 002601 | 佰利联 | | | | | | | | | | 002309 | 中利科技 | | | | | | | | | | 600585 | 海螺水泥 | | | | | |
|
|