Re : bonne formule affiche #NOM?
oui r est un double...
Voici la macro complète:
Dim LastLine_couronne As Integer
Dim LastLine_plaque As Integer
Dim cel As Range
Dim i As Integer
Dim j As Integer
Dim max As Long
Dim min As Long
Dim alpha As Long
Dim x As Double
Dim y As Double
Dim r As Double
Dim k As Integer
Dim kk As Integer
Dim kkk As Integer
alpha = 0
k = 0
kk = 0
kkk = 0
LastLine_couronne = Range("A65536").End(xlUp).Row
LastLine_plaque = Range("E65536").End(xlUp).Row
For i = 3 To LastLine_couronne
For Each cel In Union(Range("B3:B" & LastLine_couronne), Range("F3:F" & LastLine_plaque))
MsgBox (x & "," & y)
x = Cells(i, 3).Value - cel.Value
y = Cells(i, 4) - Cells(cel.Row, cel.Column + 1)
MsgBox (x & "," & y)
If x = 0 Then
k = k + 1
GoTo toto
ElseIf x < 0 Then
kk = kk + 1
r = y / x
Cells(20, 8).Formula = "=90-DEGRES(ATAN(" & r & "))"
ElseIf x < 0 Then
kkk = kkk + 1
r = y / x
Cells(20, 8).Formula = "=270-DEGRES(ATAN(" & r & "))"
End If
MsgBox (k & "," & kk & "," & kkk)
If alpha < Cells(20, 8).Value Then alpha = Cells(65000, 40).Value
MsgBox (alpha)
toto:
Next cel
Next i
End Sub