Автор Александр Трофимов задал вопрос в разделе Другие языки и технологии
VBA: получать курс доллара из интернета в Excel и получил лучший ответ
Ответ от Ольга Константинова[гуру]
Sub GetDollar()
Dim sURI As String
Dim oHttp As Object
Dim htmlcode, outstr As String
Dim inpdate As Date
Dim d, m, y As Integer
inpdate = CDate(InputBox("Введите дату в формате ДД. ММ. ГГГГ", _
"Курс доллара", Date))
d = Format(inpdate, "dd")
m = Format(inpdate, "mm")
y = Format(inpdate, "yyyy")
sURI = "=" & M & "&C_year=" _
& y & "&date_req=" & d & "/" & M & "/" & y
On Error Resume Next
Set oHttp = CreateObject("MSXML2.XMLHTTP")
If Err.Number <> 0 Then
Set oHttp = CreateObject("MSXML.XMLHTTPRequest")
End If
On Error GoTo 0
If oHttp Is Nothing Then
Exit Sub
End If
oHttp.Open "GET", sURI, False
oHttp.Send
htmlcode = oHttp.responseText
outstr = Mid(htmlcode, InStr(1, htmlcode, "USD") + 87, 7)
Set oHttp = Nothing
outstr = Replace(outstr, ",", ".")
ActiveCell.Value = outstr
End Sub
Создаешь модуль и копипуешь туда этот текст.
курс доллара к японской ене? уточни
на каком сайте ты обычно смотришь этот самый курс?