Option Explicit
Sub Test()
Dim Wsh As Worksheet, TD(), LMax As Long, TR(), L As Long
On Error Resume Next
Set Wsh = Worksheets("Résultats")
If Err Then Err.Clear: Set Wsh = Worksheets("RESULTATS")
If Err Then MsgBox "L'onglet ""RESULTAT"" n'existe pas dans le classeur actif.", _
vbCritical, "Test": Exit Sub
If Wsh.[C1].Value = "Coût" Then Wsh.Columns("C").Delete
TD = Wsh.[B2].Resize(Wsh.[A1000000].End(xlUp).Row - 1, 2).Value
LMax = UBound(TD, 1)
ReDim TR(1 To LMax, 1 To 1)
For L = 1 To LMax
If TD(L, 2) <> 0 Then TR(L, 1) = TD(L, 1) / TD(L, 2)
If Err Then
Application.Goto Wsh.[B1:C1].Offset(L)
MsgBox "Err " & Err & " sur :" & vbLf & TD(L, 1) & " / " & TD(L, 2) _
& vbLf & Err.Description, vbCritical, "Test"
Exit Sub: End If
Next L
Wsh.Columns("C").Insert
With Wsh.[C1]: .Value = "Coût": .Interior.Color = RGB(0, 128, 0): End With
Wsh.[C2].Resize(LMax).Value = TR
End Sub