ajoute option de calcul sinon c'est interminable !
Sub Maj()
timedebut = Now()
With Application
.ScreenUpdating = False
.DisplayAlerts = False
.Calculation = xlCalculationManual
End With
Dim ws As Worksheet
Application.DisplayAlerts = False
For Each ws In ActiveWorkbook.Worksheets
Debug.Print ws.Name
With ws
If .Name <> "Interrogation" And .Name <> "CMC" And .Name <> "Calculs" Then ws.Delete
End With
Next
Dim i%, k%, URL$, obj As New DataObject
k = Cells(Rows.Count, [www].Column).End(xlUp).Row
On Error Resume Next
For i = [debut].Row + 1 To k
DoEvents
URL = Sheets("Interrogation").Cells(i, [www].Column).Value
On Error Resume Next
With CreateObject("MSXML2.XMLHTTP")
.Open "GET", URL, False
.Send
If .Status = 200 Then
If i > [debut].Row Then
txt = [avant] & Split(Split(.responseText, [avant])(1), [apres])(0) & [apres]
obj.SetText txt
obj.PutInClipboard
ActiveWorkbook.Sheets.Add Before:=Worksheets(Worksheets.Count)
ActiveSheet.Paste
ActiveSheet.Name = Sheets("Interrogation").Cells(i, [debut].Column).Value
End If
End If
End With
Cells.Select
Selection.ColumnWidth = 40
Cells.EntireColumn.AutoFit
Cells.EntireRow.AutoFit
Next
With Application
.ScreenUpdating = True
.DisplayAlerts = True
.Calculation = xlCalculationAutomatic
End With
MsgBox ("Terminé en " & Format((Now() - timedebut), "n' ss''") & " !")
End Sub