请教一下大神们,如果单元格的代码,如首字符是6(是字符串,不是数字),则URL = "http://qt.gtimg.cn/q=sh" & Cells(r, 1).Value,否则URL = "http://qt.gtimg.cn/q=sz" & Cells(r, 1).Value
以下为需要更改的代码
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
Next
End Sub
这个代码要怎么改