在网上找了一个小的数据源,大的来源分析复杂
'更新港币汇率
Cells(1, 10) = "0" '现值
strUrl = "https://chl.cn/huilv/?hkd-2024" '按年更新
xmlobject.Open "GET", strUrl, False
xmlobject.send
If xmlobject.readystate = 4 Then
strReturn = xmlobject.responsetext
p1 = InStr(1, strReturn, "1港币=<span>")
p2 = InStr(p1, strReturn, "元")
'获取目标数据
Cells(1, 10) = Mid(strReturn, p1 + 10, p2 - p1 - 10)
End If