Dim x As Control
With Sheets("Fiche_d_evaluation_des_risques")
Nl = .Range("B65536").End(xlUp).Row + 1 'Facturation comptable
.Range("B" & Nl).FormulaR1C1 = "=R[-1]C+1"
.Range("C" & Nl).Value = TextBox1.Value 'Situation dangeureuse
.Range("E" & Nl).Value = TextBox2.Value ' Dommage éventuel
.Range("L" & Nl).Value = TextBox3.Value ' Moyen éxistant
.Range("M" & Nl).Value = TextBox4.Value ' Moyen à proposer
.Range("N" & Nl).Value = TextBox5.Value ' Commentaires
For Each x In Frame1.Controls ' Contôle ma valeur des boutons si true
If x.Value = True Then
.Range("H" & Nl).Value = x.Caption 'Taux de fréquence
End If
Next
For Each x In Frame2.Controls
If x.Value = True Then
.Range("i" & Nl).Value = x.Caption 'Taux de gravité
End If
Next
.Range("J" & Nl).FormulaR1C1 = _
"=RC[-2]*RC[-1]*RC[1]&CHAR(10)&""Risque ""&IF(RC[1]=1,IF(RC[7]=1,""Prioritaire"",IF(RC[7]=2,""Sérieux"",""Mineur"")),IF(RC[1]=0.5,IF(RC[8]=2,""Sérieux"",""Mineur""),""Mineur""))" ' Commentaires
[COLOR="Green"]'.Range("K" & N1).FormulaR1C1 = "=IF(AND(NOT(RC[1]=""""),NOT(RC[3]="""")),0.5,IF(AND(NOT(RC[1]=""""),RC[3]=""""),0.25,1))"[/COLOR]
.Range("Q" & Nl).FormulaR1C1 = "=HLOOKUP(RC[-8],R7C5:R11C9,RC[-9]+1)"
.Range("R" & Nl).FormulaR1C1 = "=HLOOKUP(RC[-9],R7C5:R11C9,RC[-10]+1)+1"
.Range("S" & Nl).FormulaR1C1 = "=ROUNDUP(RC[-2]+1,0)"
End With