Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False 'désactive les évènements
With [A1] 'cellule à adapter
If Target.Address = .Address Then .Select
.Value = Application.Min(Application.Max(1, Int(Val(.Text))), Rows.Count - .Row + 1)
Application.ScreenUpdating = False
.Offset(, 1) = 1
.Offset(, 1).Resize(.Value).DataSeries
If .Value <= Rows.Count - .Row Then .Offset(, 1).Offset(.Value).Resize(Rows.Count - .Value - .Row + 1).ClearContents 'RAZ en dessous
End With
Application.EnableEvents = True 'réactive les évènements
End Sub