Sub Etude_Serie1()
Dim x1, x2, x3, x4, debut&, fin&, a, m, b, seb, decal, i&
x1 = -30
x2 = -20
x3 = -10
x4 = 10
With [A1].CurrentRegion
    '---1ère butée---
    debut = Application.Match(x1, .Columns(1))
    fin = Application.Match(x2, .Columns(1))
    Range(.Cells(debut, 1), .Cells(fin, 1)).Name = "X" 'plage nommée
    Range(.Cells(debut, 2), .Cells(fin, 2)).Name = "Y" 'plage nommée
    a = [LINEST(Y,X,1,1)] 'DROITEREG avec statistiques
    m = Application.Index(a, 1, 1)
    b = Application.Index(a, 1, 2)
    seb = Application.Index(a, 2, 2) 'écart-type sur b
    decal = 5 '5 fois l'écart-type
    For i = fin To .Rows.Count
        If .Cells(i, 2) > m * .Cells(i, 1) + b + decal * seb Then
            MsgBox "1ère butée au point " & i & " d'abscisse " & .Cells(i, 1), , "Série1"
            Exit For
        End If
    Next i
    '---2ème butée---
    debut = Application.Match(x3, .Columns(1))
    fin = Application.Match(x4, .Columns(1))
    Range(.Cells(debut, 1), .Cells(fin, 1)).Name = "X" 'plage nommée
    Range(.Cells(debut, 2), .Cells(fin, 2)).Name = "Y" 'plage nommée
    a = [LINEST(Y,X,1,1)] 'DROITEREG avec statistiques
    m = Application.Index(a, 1, 1)
    b = Application.Index(a, 1, 2)
    seb = Application.Index(a, 2, 2) 'écart-type sur b
    decal = 38 '38 fois l'écart-type
    For i = fin To .Rows.Count
        If .Cells(i, 2) > m * .Cells(i, 1) + b + decal * seb Then
            MsgBox "2ème butée au poinr " & i & " d'abscisse " & .Cells(i, 1), , "Série1"
            Exit For
        End If
    Next i
End With
End Sub
Sub Etude_Serie2()
Dim x1, x2, x3, x4, debut&, fin&, a, m, b, seb, decal, i&
x1 = 30
x2 = 20
x3 = 10
x4 = -10
With [D1].CurrentRegion
    '---1ère butée---
    debut = Application.Match(x1, .Columns(1), -1)
    fin = Application.Match(x2, .Columns(1), -1)
    Range(.Cells(debut, 1), .Cells(fin, 1)).Name = "X" 'plage nommée
    Range(.Cells(debut, 2), .Cells(fin, 2)).Name = "Y" 'plage nommée
    a = [LINEST(Y,X,1,1)] 'DROITEREG avec statistiques
    m = Application.Index(a, 1, 1)
    b = Application.Index(a, 1, 2)
    seb = Application.Index(a, 2, 2) 'écart-type sur b
    decal = 0 '0 fois l'écart-type
    For i = fin To .Rows.Count
        If .Cells(i, 2) < m * .Cells(i, 1) + b - decal * seb Then
            MsgBox "1ère butée au point " & i & " d'abscisse " & .Cells(i, 1), , "Série2"
            Exit For
        End If
    Next i
    '---2ème butée---
    debut = Application.Match(x3, .Columns(1), -1)
    fin = Application.Match(x4, .Columns(1), -1)
    Range(.Cells(debut, 1), .Cells(fin, 1)).Name = "X" 'plage nommée
    Range(.Cells(debut, 2), .Cells(fin, 2)).Name = "Y" 'plage nommée
    a = [LINEST(Y,X,1,1)] 'DROITEREG avec statistiques
    m = Application.Index(a, 1, 1)
    b = Application.Index(a, 1, 2)
    seb = Application.Index(a, 2, 2) 'écart-type sur b
    decal = 16 '16 fois l'écart-type
    For i = fin To .Rows.Count
        If .Cells(i, 2) < m * .Cells(i, 1) + b - decal * seb Then
            MsgBox "2ème butée au poinr " & i & " d'abscisse " & .Cells(i, 1), , "Série2"
            Exit For
        End If
    Next i
End With
End Sub