sandrine13 a écrit :
ok, alors peut-on lui rajouter si textbox vide ignorer
Re,
Oui ... on peut ...
Mais à ton avis ...est-ce-que c'est la bonne solution ... ???
Private Sub CreateModife(Lig)
Dim C As Long
Application.Calculation = xlCalculationManual
For C = 1 To 22
Select Case C
Case 6, 8, 9
Sh.Cells(Lig, C).Value = CDate(Controls("TextBox" & C).Value)
Case 7
Sh.Cells(Lig, C).FormulaR1C1 = "=Age(RC[-1],MIN(R1C1,RC[2]))"
Case 10
Sh.Cells(Lig, C).FormulaR1C1 = "=IF(RC[-1]="""","""",IF((RC[-1]-R1C1)<=0,0,RC[-1]-R1C1))"
Case 12 To 15
' Tester si les trois textboxes sont remplies ou pas ...
If Controls("TextBox" & C).Value <> "" Then
Sh.Cells(Lig, C).Value = CDbl(Controls("TextBox" & C).Value)
End If
Case Else
Sh.Cells(Lig, C).Value = Controls("TextBox" & C).Value
End Select
Next C
Application.Calculation = xlCalculationAutomatic
End Sub