Private Sub CommandButton3_click()
Application.ScreenUpdating = False
Dim DernLign As Long
Dim NB&, cell As Range
With Sheets("Alimentation")
'On mémorise dans DernLign le numéro de la première ligne libre de la feuille Alimentation
DernLign = .Cells(.Rows.Count, 4).End(xlUp).Row + 1
'On met à jour la feuille Alimentation avec les données du Userform
If TextBox6.Value = "" Then
TextBox6.Value = 0
.Cells(DernLign, 4).Value = TextBox6.Value * 1250
End If
With Sheets("Identifiants")
Call Comptage
NB = 0
Application.ScreenUpdating = False
With Sheets("Identifiants")
For Each cell In Range("F2:F65536")
If cell <> "" Then NB = NB + 1 'possibilité de compter les "M" ou les "F"
Next cell
End With
Application.ScreenUpdating = True
TextBox7.Value = NB
.Cells(DernLign, 5).Value = TextBox7.Value
'.Cells(DernLign, 6).Value = .Cells(DernLign, 4) - .Cells(DernLign, 6).Value
Cells(2, 12).Value = TextBox8.Value
End With
End With
Application.ScreenUpdating = True
End Sub
End Sub