Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next 'sélection de plus d'une cellule
If Target.Column = 1 Then
l = Len(Target)
If Not IsNumeric(Target) Or l = 0 Or l > 7 Then
Application.EnableEvents = False
Target = ""
Application.EnableEvents = True
End
Else
Application.EnableEvents = False
Target.NumberFormat = "@"
Target = Application.WorksheetFunction.Rept("0", 8 - l) & Target
Application.EnableEvents = True
End If
End If
End Sub