Function Portée(Canon, Buse, Pression)
Application.Volatile
With Sheets("Calcul")
For L = 2 To .Range("A65500").End(xlUp).Row
If .Cells(L, 1) = Canon And .Cells(L, 2) = Buse And .Cells(L, 3) > Pression Then
Exit For
End If
Next L
Portée1 = Cells(L, 4): Portée2 = Cells(L - 1, 4)
Pression1 = Cells(L, 3): Pression2 = Cells(L - 1, 3)
CoefA = (Portée1 - Portée2) / (Pression1 - Pression2)
CoefB = Portée1 - CoefA * Pression1
Portée = CoefA * Pression + CoefB
End With
End Function
Function Débit(Canon, Buse, Pression)
Application.Volatile
With Sheets("Calcul")
For L = 2 To .Range("A65500").End(xlUp).Row
If .Cells(L, 1) = Canon And .Cells(L, 2) = Buse And .Cells(L, 3) > Pression Then
Exit For
End If
Next L
Débit1 = Cells(L, 5): Débit2 = Cells(L - 1, 5)
Pression1 = Cells(L, 3): Pression2 = Cells(L - 1, 3)
CoefA = (Débit1 - Débit2) / (Pression1 - Pression2)
CoefB = Débit1 - CoefA * Pression1
Débit = CoefA * Pression + CoefB
End With
End Function