Je ne peux joindre mon fichier car il est suppérieur à 50 ko. je t'envoie le programme de mon usf. J'espère que cela t'aidera.Merci encore.
Private Sub VALIDER_Click()
Dim voperationnum As Long
Sheets('OPERATION').Activate
ActiveSheet.Unprotect Password:='17121967'
vdate = Format(vdate, 'dd-mmm-yy')
Range('a1').End(xlDown).Select
voperationnum = Selection.Value + 1
ActiveSheet.Range('a1').End(xlDown).Offset(1, 0).Select
ActiveCell.Value = voperationnum
[b65536].Select
Selection.End(xlUp)(2).Select
With ActiveCell
Selection.NumberFormat = 'dd-mmmm-yy'
.Value = vdate
.Offset(0, 1).Value = typeachat
If vcheque = True Then
.Offset(0, 2).Value = 'Chèque'
End If
If vprelvmt = True Then
.Offset(0, 2).Value = 'Prélèvement'
End If
If vcartebleuecora = True Then
.Offset(0, 2).Value = 'Carte Bleue ou Cora'
End If
If vautre = True Then
.Offset(0, 2).Value = 'Autre'
End If
.Offset(0, 3).Value = vN°operation
.Offset(0, 4).Value = vcommentaire
.Offset(0, 5).Value = vdebit
.Offset(0, 6).Value = vcredit
[I65536].Select
Selection.End(xlUp)(2).Select
ActiveCell.FormulaR1C1 = _
'=IF(RC[-2]='''',R[-1]C+RC[-1],IF(RC[-1]='''',R[-1]C-RC[-2],''''))'
End With
Range('b3:H2000').Select
Selection.Sort Key1:=Range('B3'), Order1:=xlAscending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortTextAsNumbers
Range('a1').Select
ActiveSheet.Protect Password:='17121967'
typeachat = ''
vcheque = ''
vprelvmt = ''
vcartebleuecora = ''
vautre = ''
vN°operation = ''
vcommentaire = ''
vdebit = ''
vcredit = ''
Sheets('TABLEAU DE BORD').Activate
Range('a1').Select
End Sub