Bonjour,
Prenez le dernier fichier fonctionne chez vous et ne remplacez que la fonction personnalisée fausse par celle-ci.
Function Ampl(Plage As Range, Ligne As Long) As Double
Dim i As Long, DerCol As Long, deb As Double, fin As Double
DerCol = Range("ZZ8").End(xlToLeft).Column
For i = 6 To DerCol
If Cells(Ligne, i).Interior.ColorIndex <> xlNone Then
deb = i
GoTo Heure_Fin
End If
Next i
Heure_Fin:
For i = DerCol To 6 Step -1
If Cells(Ligne, i).Interior.ColorIndex <> xlNone Then
fin = i + 1
If fin - deb > 0 Then
Ampl = (fin - deb) / 2
Exit For
Else
Ampl = 0
Exit For
End If
End If
Next i
End Function
la formule des amplitudes en D12 , à recopier sur les autres cellules:
=SIERREUR(Ampl(E12:AQ12;LIGNE());"")
Pour aller sur le module VBA, faire ALT + F11
Cdlt