Option Explicit
Sub MajCotations()
On Error Resume Next
Dim WS As Worksheet, Hobj As Object, URL$, COT, chn$, k%, i%
Set WS = ThisWorkbook.Worksheets("COTATIONS ACTUALISATION")
k = WS.Cells(Rows.Count, [REF].Column).End(xlUp).Row
If k = 1 Then Exit Sub
Application.ScreenUpdating = 0: WS.Range(WS.Cells(2, 4), WS.Cells(k, 4)).Clear
For i = 2 To k
DoEvents
ReDim COT(1 To k, 1 To 1)
COT(1, 1) = WS.Cells(i, [Cotation].Column).Value
URL = WS.Cells(i, [WWW].Column).Value
Application.StatusBar = "Mise à jour des cotations en cours …"
Set Hobj = CreateObject("MSXML2.XMLHTTP")
With Hobj
.Open "GET", URL, False: .Send
If .Status = 200 Then
chn = Split(Split(.responsetext, _
"<span class=""c-instrument c-instrument--last"" data-ist-last>")(1), _
"</span>")(0)
WS.Cells(i, [Cotation].Column).Value = Val(chn)
End If
End With
Application.StatusBar = False
Next i
End Sub